size | R Documentation |
Provides the dimensions of x
.
size(x, k)
x |
vector, matrix, or array |
k |
integer specifying a particular dimension |
Returns the number of dimensions as length(x)
.
Vector will be treated as a single row matrix.
vector containing the dimensions of x
, or the k
-th dimension
if k
is not missing.
The result will differ from Matlab when x
is a character vector.
dim
size(1:8)
size(matrix(1:8, 2, 4)) # 2 4
size(matrix(1:8, 2, 4), 2) # 4
size(matrix(1:8, 2, 4), 3) # 1
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.