aggregating for for data frames
daggregate(
data,
y = NULL,
x = NULL,
subset,
...,
fun = "summary",
regex = mets.options()$regex,
missing = FALSE,
remove.empty = FALSE,
matrix = FALSE,
silent = FALSE,
na.action = na.pass,
convert = NULL
)
data.frame
name of variable, or formula, or names of variables on data frame.
name of variable, or formula, or names of variables on data frame.
subset expression
additional arguments to lower level functions
function defining aggregation
interpret x,y as regular expressions
Missing used in groups (x)
remove empty groups from output
if TRUE a matrix is returned instead of an array
suppress messages
How model.frame deals with 'NA's
if TRUE try to coerce result into matrix. Can also be a user-defined function
data("sTRACE")
daggregate(iris, "^.e.al", x="Species", fun=cor, regex=TRUE)
daggregate(iris, Sepal.Length+Petal.Length ~Species, fun=summary)
daggregate(iris, log(Sepal.Length)+I(Petal.Length>1.5) ~ Species,
fun=summary)
daggregate(iris, "*Length*", x="Species", fun=head)
daggregate(iris, "^.e.al", x="Species", fun=tail, regex=TRUE)
daggregate(sTRACE, status~ diabetes, fun=table)
daggregate(sTRACE, status~ diabetes+sex, fun=table)
daggregate(sTRACE, status + diabetes+sex ~ vf+I(wmi>1.4), fun=table)
daggregate(iris, "^.e.al", x="Species",regex=TRUE)
dlist(iris,Petal.Length+Sepal.Length ~ Species |Petal.Length>1.3 & Sepal.Length>5,
n=list(1:3,-(3:1)))
daggregate(iris, I(Sepal.Length>7)~Species | I(Petal.Length>1.5))
daggregate(iris, I(Sepal.Length>7)~Species | I(Petal.Length>1.5),
fun=table)
dsum(iris, .~Species, matrix=TRUE, missing=TRUE)
par(mfrow=c(1,2))
data(iris)
drename(iris) <- ~.
daggregate(iris,'sepal*'~species|species!="virginica",fun=plot)
daggregate(iris,'sepal*'~I(as.numeric(species))|I(as.numeric(species))!=1,fun=summary)
dnumeric(iris) <- ~species
daggregate(iris,'sepal*'~species.n|species.n!=1,fun=summary)
Run the code above in your browser using DataLab