Learn R Programming

mosaic (version 0.4-1)

prop: Compute proportions, percents, or counts for a single level

Description

Compute proportions, percents, or counts for a single level

Usage

prop(..., level = NULL, long.names = TRUE, sep = ":",
    format = "proportion")

count(..., format = "count")

perc(..., format = "percent")

Arguments

...
arguments passed through to tally
level
the level for which counts, proportions or percents are calculated
long.names
a logical indicating whether long names should be when there is a conditioning variable
sep
a character used to separate portions of long names
format
one of proportion, percent, or count, possibly abbrevaited

Examples

Run this code
prop( ~sex, data=HELPrct)
prop( ~sex, data=HELPrct, level='male')
count( ~sex | substance, data=HELPrct)
prop( ~sex | substance, data=HELPrct)
perc( ~sex | substance, data=HELPrct)

Run the code above in your browser using DataLab