Examples for 'base::dim'


Dimensions of an Object

Aliases: dim dim.data.frame dim<-

Keywords: array

### ** Examples

x <- 1:12 ; dim(x) <- c(3,4)
x
     [,1] [,2] [,3] [,4]
[1,]    1    4    7   10
[2,]    2    5    8   11
[3,]    3    6    9   12
# simple versions of nrow and ncol could be defined as follows
nrow0 <- function(x) dim(x)[1]
ncol0 <- function(x) dim(x)[2]

[Package base version 4.2.3 Index]