ncol(x) nrow(x)
NA
s) are allowed.
ncol
returns the number of columns in
x
.
nrow
returns the number of rows in
x
.
These functions are generic in the sense that they are based on the
dim
function which is generic.
ncol(freeny.x) # create a matrix of 0's the same size as freeny.x x <- matrix(numeric(length(freeny.x)), nrow = nrow(freeny.x))