by_scale | R Documentation |
Split a dataframe into a list according to the levels of variables in the dataframe and scale the numeric variables in each dataframe in the list.
scaleBy(formula, data = parent.frame(), center = TRUE, scale = TRUE)
scale_by(data, formula, center = TRUE, scale = TRUE)
formula |
Variables to split data frame by, as |
data |
A dataframe or matrix |
center |
Logical, should data be centered. |
scale |
Logical, should data be scaled. |
A list of objects of same class as x
Søren Højsgaard, sorenh@math.aau.dk
orderBy
, order_by
,
summaryBy
, summary_by
,
transformBy
, transform_by
scaleBy(~Species, data=iris, center=TRUE, scale=FALSE)
scaleBy(~1, data=iris, center=TRUE, scale=FALSE)
scale_by(iris, ~Species)
scale_by(iris, ~1)
## Not combine list of dataframes to one dataframe e.g. as:
a <- scale_by(iris, ~Species)
d <- do.call(rbind, a)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.