powered by
Gets the number of elements in an object.
n_elements(x)
Any object.
A non-negative integer of the number of elements.
DIM
# NOT RUN { n_elements(1:10) n_elements(NULL) n_elements(data.frame(x = 1:5, y = rnorm(5))) n_elements(list(1:5, list(1:3, list(1:7)))) n_elements(var) # depends upon the length of the body # }
Run the code above in your browser using DataLab