# NOT RUN {
library(magrittr)
df = data.frame(
plot = factor(paste0("p", rep(1:8, times = 2))),
site = factor(paste0("s", rep(1:4, each = 2, times = 2)))
)
# without changing `.n_name`, compose_data() will prefix indices
# with "n" by default
df %>%
compose_data()
# you can use n_prefix() to define a different prefix (e.g. "N"):
df %>%
compose_data(.n_name = n_prefix("N"))
# }
Run the code above in your browser using DataLab