Learn R Programming

descriptr (version 0.3.0)

ds_group_summary: Descriptive Statistics By Group

Description

ds_group_summary returns descriptive statistics of a continuous variable for the different levels of a categorical variable. boxplot.group_summary creates boxplots of the continuous variable for the different levels of the categorical variable.

Usage

ds_group_summary(fvar, cvar)

# S3 method for ds_group_summary boxplot(x, ...)

Arguments

fvar

a factor variable

cvar

a continuous variable

x

an object of the class ds_group_summary

...

further arguments to be passed to or from methods

Value

ds_group_summary returns an object of class "ds_group_summary". An object of class "ds_group_summary" is a list containing the following components:

stats

a data frame containing descriptive statistics for the different levels of the factor variable

plotdata

data for boxplot method

xvar

name of the categorical variable

yvar

name of the continuous variable

Deprecated Function

ds_group_summary() has been deprecated. Instead use ds_group_summary().

See Also

link{ds_summary_stats}

Examples

Run this code
# NOT RUN {
# ds_group summary
mt <- mtcars
mt$cyl <- as.factor(mt$cyl)
ds_group_summary(mt$cyl, mt$mpg)

# boxplot
k <- ds_group_summary(mt$cyl, mt$mpg)
boxplot(k)
# }

Run the code above in your browser using DataLab