Description Usage Arguments Details Value Author(s) See Also Examples
This function consolidates size dimensions for one and two dimensional data structures. The idea is that many operations require knowing either how long a vector is or how many rows are in a matrix. So rather than switching between length and nrow, anylength provides the appropriate polymorphism to return the proper value.
1 |
... |
Abstract function controlled by lambda.r |
anylength(data) data - An object
When working with libraries, it is easy to forget the return type of a
function, particularly when there are a lot of switches between vectors,
matrices, and other data structures. This function along with its
anynames
counterpart provides a single interface for accessing
this information across objects.
The core assumption is that in most cases length is semantically synonomous with nrow such that the number of columns in two-dimensional structures is less consequential than the number of rows. This is particularly true of time-based objects, such as zoo or xts where the number of observations is equal to the number of rows in the structure.
The length or nrow of the object
Brian Lee Yung Rowe
1 2 3 4 5 |
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.