Description Usage Arguments Examples
View source: R/xsummarise_each.r
extended version of summarise_each that allows alternative arrangement of outputs
1 2 | xsummarise_each(tbl, funs, ..., .long = "funs", .wide = NA,
.fun.var = ".fun", .var.var = ".var")
|
tbl |
the date frame |
funs |
a list of functions, see the help of summarize_each, best use the helper function funs() to create them |
... |
columns in tbl on which the functions should be applied |
.long |
either "funs" or "vars". Shall variables or functions be put in different rows? |
.wide |
currently ignored |
1 2 3 4 5 6 7 8 9 10 11 12 | ## Not run:
library(dplyr)
library(dplyrExtras)
by_species <- group_by(iris,Species)
summarise_each(by_species,funs(min=min, max=max, mean=mean), Petal.Width, Sepal.Width)
xsummarise_each(by_species,funs(min=min, max=max(.,na.rm=TRUE)), Petal.Width, Sepal.Width, .long="vars", .var.var = "Variable")
xsummarise_each(by_species,funs(min=min, max=max), Petal.Width, Sepal.Width, .long="funs")
xsummarise_each_(by_species,funs(min, max), vars=c("Petal.Width", "Sepal.Width"))
xsummarise_each_(by_species,funs(min, max), vars=c("Petal.Width", "Sepal.Width"), .long="vars", .var.var = "Variable")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.