colSums() function in R Language is used to compute the sums of matrix or array columns.
Syntax: colSums (x, na.rm = FALSE, dims = 1)
x: matrix or array
dims: this is integer value whose dimensions are regarded as ‘columns’ to sum over. It is over dimensions 1:dims.
[, 1] [, 2] [, 3] [1, ] 1 4 7 [2, ] 2 5 8 [3, ] 3 6 9  6 15 24
,, 1 [, 1] [, 2] [, 3] [1, ] 1 3 5 [2, ] 2 4 6,, 2 [, 1] [, 2] [, 3] [1, ] 7 9 11 [2, ] 8 10 12,, 3 [, 1] [, 2] [, 3] [1, ] 1 3 5 [2, ] 2 4 6 [, 1] [, 2] [, 3] [1, ] 3 15 3 [2, ] 7 19 7 [3, ] 11 23 11  21 57 21
- Getting a Matrix of number of columns in R Programming - col() Function
- Naming Rows and Columns of a Matrix in R Programming - rownames() and colnames() Function
- Scale the Columns of a Matrix in R Programming - scale() Function
- Calculate the Mean of each Column of a Matrix or Array in R Programming - colMeans() Function
- Calculate the cross-product of a Matrix in R Programming - crossprod() Function
- Calculate the cross-product of the Transpose of a Matrix in R Programming - tcrossprod() Function
- Calculate Trace of a Matrix in R Programming - tr() Function
- Get the number of columns of an Object in R Programming - ncol() Function
- Merge Two Data Frames by common Columns in R Programming - merge() Function
- Rename Columns of a Data Frame in R Programming - rename() Function
- Choose Specific Columns of a Data Frame in R Programming - select() Function
- Calculate Cumulative Sum of a Numeric Object in R Programming - cumsum() Function
- Combine Vectors, Matrix or Data Frames by Columns in R Language - cbind() Function
- Check if the Object is a Matrix in R Programming - is.matrix() Function
- Convert a Data Frame into a Numeric Matrix in R Programming - data.matrix() Function
- Convert an Object into a Matrix in R Programming - as.matrix() Function
- Compute the Sum of Rows of a Matrix or Array in R Programming - rowSums Function
- Calculate arc cosine of a value in R programming - acos() function
- Calculate arc tangent of a value in R programming - atan2(y, x) function
- Calculate cosine of a value in R Programming - cos() Function
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to email@example.com. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.