freq.mc: freq.mc

Description Usage Arguments Details Value

Description

Creates a multiple choice frequency table from the column vectors in a data.frame.

Usage

1
2
freq.mc(x, cells = c("count", "pct"), yes.answer = NULL, row.number = 1,
  weight = NULL)

Arguments

x

a data.frame

yes.answer

a character value that can be used to match which element of a column vector to use in creating the multiple choice frequency table.

row.number

a numerical value that can be used to match which element of a column vector to use in creating the multiple choice frequency table.

Details

When working with survey data one often finds oneself with a single variable for each element of a multiple choice question. This function performs a frequency table on each variable in x and compounds the yes.answer into a single frequency table and stores it in a data.frame.

If a column vector within x does not have an answer attribute acribed to it, then yes.answer and row.number can be used to match which element of the vector the function should use instead.

Value

a data.frame


antongrau/soc.report documentation built on May 10, 2019, 12:25 p.m.