addn | R Documentation |
This function is used to modify a column containing a categorical covariate to add the number of occurences. It is mostly used with boxplot (inside plot_boxplot
function for instance).
addn(dataset, col, ...)
dataset |
dataset to modify |
col |
a column to modify |
... |
all columns to used for grouping (ID most of the time) |
Thibaud Derippe (Thibaud.Derippe@gmail.com)
mtcars %>% addn(carb) %>% ggplot()+ geom_boxplot(aes(carb, mpg)) Theoph %>% mutate(cov = sample(LETTERS[1:3], size = nrow(Theoph), replace = T)) %>% addn(cov, Subject)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.