n_obs | R Documentation |
Returns the number of observations of a vector or data.frame. It uses
vctrs::vec_size()
under the hood.
n_obs(x, names = TRUE)
x |
vector or data.frame |
names |
logical; If TRUE the result is a named vector named "n_obs", else it is just the number of observations. |
number of observations
You cannot use n_obs
with features
counting the key variable like
so - features(heights, country, n_obs)
. Instead, use any other variable.
n_obs(iris)
n_obs(1:10)
add_n_obs(heights)
heights %>%
features(height_cm, n_obs) # can be any variable except id, the key.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.