powered by
tsibble
Here, we are not counting the number of rows in the dataset, but rather we are counting the number observations for each keys in the data.
add_n_obs(.data, ...)
tsibble with n_obs, the number of observations per key added.
n_obs
extra arguments
library(dplyr) # you can explore the data to see those cases that have exactly two # observations: heights %>% add_n_obs() %>% filter(n_obs == 2)
Run the code above in your browser using DataLab