basic_stats: Basic Statistics by Group

Description Usage Arguments Examples

Description

Basic Statistics by Group

Usage

1
basic_stats(data, x, y, f)

Arguments

data

a dataframe

x

the variable name you want to caculate on

y

the variable name group by, which shoule be a categorical variable

f

the basic r function you want to use to perform on the x variable

Examples

1
2
3
4
5
6
7
## Continues variable stats
basic_stats(sleepdata, "Weight", "DayType", max)
basic_stats(sleepdata, "Weight", "DayType", mean)
basic_stats(sleepdata, "Weight", "DayType", median)

## Categorical variable stats
basic_stats(sleepdata, "HavingDog", "DayType", table)

poorbaby/r_package_sha documentation built on May 29, 2019, 7:38 a.m.