powered by
The shape of a vector is its vec_dim() (i.e. dim() or length()) and whether or not it's a data frame.
vec_dim()
dim()
length()
vec_shape(..., data.frame = FALSE)vec_reshape(x, shape)
vec_reshape(x, shape)
Does this shape represent a data frame? Data frames must be 2 dimensional, and can only be recycled along the first dimension.
For shape(), a vector giving dimensions of an object. For as_vec_shape(), an existing data vector
shape()
as_vec_shape()
# NOT RUN { vec_shape(1:10) vec_shape(1:10, 1) # } # NOT RUN { vec_shape(1:10, 1) # } # NOT RUN { vec_shape(mtcars) # }
Run the code above in your browser using DataLab