d | R Documentation |
A common function to compute the number of elements (in vectors and lists) or the number of vectors in each dimension (dataframes, matrices, and arrays) of common types of R
objects.
d(x)
x |
An input object whose dimensions will be computed. |
Returns a length-n
integer vector where n
is the number of dimensions in x
(e.g. n=1
for atomic vectors and lists, n=2
for matrices and dataframes, and n
may be more than 2 for some arrays). Each element in the output is the number of elements in that dimension of x
(e.g. if n=1
, the number of elements in the list or vector, if n=2
, first the number of rows in the dataframe or matrix, then the number of columns).
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.