View source: R/sumStatDeluxe.R
sumStatDeluxe | R Documentation |
This function computes a selection of summary statistics on a data frame which contains response variables and categorical variables. If there is only one response variable, the results are returned in a data frame. For more than one response variable, the results are returned in a list of data frames. See the examples.
sumStatDeluxe(data = NULL, groupVars = NULL, respVars = NULL, ci = 0.95, ...)
data |
A data frame containing the variables. |
groupVars |
Character. A vector of the categorical variable names. |
respVars |
Character. A vector of the response variable names. |
ci |
Numeric. The confidence interval desired. |
... |
Other parameters to be passed downstream. |
Either a data frame (one response variable) or a list of data frames
(more than one response variable). Each data frame row has summary statistics
for a given groupVars
. The summary includes the number of observations,
the standard deviation and standard error, the mean, and upper and lower
confidence intervals.
require('plyr') ### One response variable returns a data frame: tst <- sumStatDeluxe(chickwts, groupVars = "feed", respVars = "weight") tst ### Two response variables returns a list of data frames: tst <- sumStatDeluxe(iris, groupVars = "Species", respVars = c("Sepal.Length", "Sepal.Width", "Petal.Length", "Petal.Width")) tst ### Two categorical variables, one response: tst <- sumStatDeluxe(warpbreaks, groupVars = c("wool", "tension"), respVars = "breaks") # One categorical, multiple response variables: tst <- sumStatDeluxe(airquality, groupVars = "Month", respVars = c("Ozone", "Solar.R", "Wind")) tst
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.