percent_hungry: Calculate the Percentage of Yes Responses

Description Usage Arguments Value See Also Examples

Description

Calculate the sample proportion of "Yes" responses in the specified variable.

Usage

1
percent_hungry(data_frame, yes_no_variable)

Arguments

data_frame

A tidy representation of the data, in which each row represents a response.

yes_no_variable

A "quosure" object specifying the variable that contains the "Yes" and "No" responses to be tallied. This should be passed as the form quo(varname).

Value

The proportion of "Yes" responses in yes_no_variable in data_Frame.

See Also

quo for examples of how to quote variable names

Examples

1
2
df <- data.frame(foo=c(1,2,3), bar=c("Yes", "No", "Yes"))
percent_hungry(df, dplyr::quo(bar))

jmiahjones/lunch.time documentation built on May 29, 2019, 1:05 a.m.