Learn R Programming

dst (version 1.8.0)

shape: Obtain dimensions of an array or length of a vector with a single command

Description

shape returns the dimension of given array or returns the length of a given vector. The function is taken from the project APL in R (https://rpubs.com/deleeuw/158476).

Usage

shape(a)

Value

The dimension of the array a or the length of the vector a.

Arguments

a

An array or a vector.

Author

Claude Boivin

References

  • Jan de Leeuw and Masanao Yajima (March 07, 2016) APL in R (Version 009), Source code. https://rpubs.com/deleeuw/158476

  • G. Helzer. (1989): An Encyclopedia of APL, second edition, I-APL LTD, St. Albans, G.B.

  • L. Gilman and A. J. Rose.(1974): APL an Interactive Approach, Second Edition, John Wiley, New-York.

Examples

Run this code
shape(array(c(1:6), c(2,3)))
shape(c("a", "b"))

Run the code above in your browser using DataLab