response_table: Response Table

Description Usage Arguments Details Value Examples

View source: R/response_table.R

Description

Create a table with one row for each response.

Usage

1
2
response_table(df, respondent_id_field = NULL,
  survey_year_field = NULL, excluded_fields, survey_id = NULL)

Arguments

df

The survey data frame. It should have variable labels.

respondent_id_field

The field in the data frame that uniquely identifies each respondent within that cycle of the survey.

survey_year_field

the field in the data frame that identifies the year of the survey.

excluded_fields

A list of field names that are not questions and shouldn't be included.

survey_id

A string representing the name of the survey.

Details

Extract the answers/responses from the survey file. Then we create a table where there is one row for each question per respondent – assuming they answered the question.

Value

A tibble containing all the responses of the survey, with the actual response, a character label and a score.

Examples

1
2
3
4
5
response_table(cgpss,
               survey_id = 'CGPSS',
               respondent_id_field = UNIV_RecordNum,
               survey_year_field = SURVEY_YEAR,
               excluded_fields = c('LANGUAGE', 'UNIV', 'PROGRAM_NAME', 'CIP'))

sechilds/surveyetl documentation built on June 3, 2020, 5:04 p.m.