get_numericpct: Gets percentages in a numeric variable

Description Usage Arguments Examples

Description

This function gets the percent of values in a range, inclusive. Defaults to the total percent matching a specific value if no maximum value is given.

Usage

1
get_numericpct(item, min, max = min, digits = 2)

Arguments

item

Data vector from numeric question

min

The minimum value (inclusive) from the search range

max

The maximum value (inclusive) from the search range, defaults to the minimum if not included

digits

The number of digits after the decimal for rounding the percent, default is 2

Examples

1
2
3
4
# Gets the percent of people with exactly three dogs
get_numericpct(survey$numdogs, min=3)
# Gets the percent of people aged 18 to 25, inclusive
get_numericpct(survey$age, min=18, max=25)

rblissett/pubpub documentation built on May 29, 2019, 6:53 p.m.