Calculate the cross-product of a Matrix in R Programming - crossprod() Function Last Updated : 03 Jun, 2020 Summarize Comments Improve Suggest changes Share Like Article Like Report crossprod() function in R Language is used to return the cross-product of the specified matrix. Syntax: crossprod(x) Parameters: x: numeric matrix Example 1: Python3 # R program to illustrate # crossprod function # Initializing a matrix with # 2 rows and 2 columns x <- matrix(1:4, 2, 2) # Getting the matrix representation x # Calling the crossprod() function crossprod(x) Output: [, 1] [, 2] [1, ] 1 3 [2, ] 2 4 [, 1] [, 2] [1, ] 5 11 [2, ] 11 25 Example 2: Python3 # R program to illustrate # crossprod function # Initializing a matrix with # 3 rows and 3 columns x <- matrix(1:9, 3, 3) # Getting the matrix representation x # Calling the crossprod() function crossprod(x) Output: [, 1] [, 2] [, 3] [1, ] 1 4 7 [2, ] 2 5 8 [3, ] 3 6 9 [, 1] [, 2] [, 3] [1, ] 14 32 50 [2, ] 32 77 122 [3, ] 50 122 194 Comment More infoAdvertise with us Next Article Calculate the cross-product of a Matrix in R Programming - crossprod() Function K Kanchan_Ray Follow Improve Article Tags : R Language R Matrix-Function Similar Reads Calculate the Sum of Matrix or Array columns in R Programming - colSums() Function colSums() function in R Language is used to compute the sums of matrix or array columns. Syntax: colSums (x, na.rm = FALSE, dims = 1) Parameters: x: matrix or array dims: this is integer value whose dimensions are regarded as âcolumnsâ to sum over. It is over dimensions 1:dims. Example 1: Python3 # 2 min read Calculate the cross-product of the Transpose of a Matrix in R Programming - tcrossprod() Function tcrossprod() function in R Language is used to return the cross-product of the transpose of the specified matrix. Syntax: tcrossprod(x) Parameters: x: numeric matrix Example 1: Python3 # R program to illustrate # tcrossprod function # Initializing a matrix with # 2 rows and 2 columns x <- matrix( 1 min read Calculate Cumulative Product of a Numeric Object in R Programming â cumprod() Function cumprod() function in R Language is used to calculate the cumulative product of the vector passed as argument. Syntax: cumprod(x) Parameters: x: Numeric Object Example 1: Python3 1== # R program to illustrate # the use of cumprod() Function # Calling cumprod() Function cumprod(1:4) cumprod(-1:-6) Ou 1 min read Calculate the Mean of each Column of a Matrix or Array in R Programming - colMeans() Function colMeans() function in R Language is used to compute the mean of each column of a matrix or array. Syntax: colMeans(x, dims = 1) Parameters: x: array of two or more dimensions, containing numeric, complex, integer or logical values, or a numeric data frame dims: integer value, which dimensions are r 2 min read Compute Choleski factorization of a Matrix in R Programming - chol() Function chol() function in R Language is used to compute the Choleski factorization of a real symmetric positive-definite square matrix. Syntax: chol(x, ...)Parameters: x: an object for which a method exists. The default method applies to real symmetric, positive-definite matrices  Example 1:  R # R prog 2 min read Like