get_mcmopct: Gets percentage from MCMO question

Description Usage Arguments Examples

Description

Gets percentage of values in a MCMO question with specific value. It is more often used for data checking or reporting single numbers in a document.

Usage

1
get_mcmopct(item, value, digits = 2)

Arguments

item

Data vector from MCMO question

value

The particular value being matched

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 who answered "Computer science" as an option
get_mcmopct(survey$Q3, "Computer science")
# Rounds to the nearest integer
get_mcmopct(survey$Q3, "Computer science", digits=0)

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