get_ind: Get individual data for a single wave

Description Usage Arguments Value Examples

View source: R/import_data.R

Description

Gets individual response data for a particular wave and set of variables.

Usage

1
get_ind(dir, wave, vars = c(), long = TRUE)

Arguments

dir

The path to the directory containing the subfolders for each wave. This is named "stata13_se" when downloading from UKDS.

wave

A whole number indicating the desired wave of Understanding Society data.

vars

A character vector containing the desired variables. Variables should be specified without the "w_" prefix and "pidp" is included by default. If an empty vector is provided, all variables will be returned.

long

The format of the output. If TRUE, all variable "w_" prefixes are removed and a column is added indicating the numerical wave of the data.

Value

A tibble containing individual response data for the desired wave and variables.

Examples

1
2
3
4
5
## Not run: 
get_ind(dir="path/to/directory", wave=10, vars="envhabit1")
get_ind(dir="path/to/directory", wave=9)

## End(Not run)

ch-williamson/rundsoc documentation built on Dec. 19, 2021, 2:59 p.m.