how to get number of columns in r code example
Example: how to get number of columns in matrix R
#Suppose x is a matrix
x <- matrix()
#Number of rows
nrow(x)
#Number of columns
ncol(x)
#Suppose x is a matrix
x <- matrix()
#Number of rows
nrow(x)
#Number of columns
ncol(x)