doo | R Documentation |
Provides an alternative to the dplyr:do()
using nest()
,
mutate()
and map()
to apply a function to a grouped data frame.
doo(.data, .fun, ..., unnest = TRUE)
.data |
a (grouped) data frame |
.fun |
A function, formula, or atomic vector. |
... |
Additional arguments passed on to |
unnest |
Logical argument defaults to |
If the applied function returns a data frame, then the output will be automatically unnested. Otherwise, the output includes the grouping variables and a column named "data" , which is a "list-columns" containing the results for group combinations.
a data frame
Tiago Olivoto tiagoolivoto@gmail.com
library(metan) # Head the first two lines of each environment data_ge2 %>% group_by(ENV) %>% doo(~head(., 2)) # Genotype analysis for each environment using 'gafem()' # variable PH data_ge2 %>% group_by(ENV) %>% doo(~gafem(., GEN, REP, PH, verbose = FALSE))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.