Description Usage Arguments Value Examples
Gets individual response data for multiple waves.
1 | get_ind_multiwave(dir, waves, vars, long = TRUE)
|
dir |
The path to the directory containing the subfolders for each wave. This is named "stata13_se" when downloading from UKDS. |
waves |
A vector of whole numbers indicating the desired waves of Understanding Society data. |
vars |
A character vector containing the desired variables. Variables should appear in all specified waves. 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, data is returned in "long" format with all variable "w_" prefixes removed and with a column to indicate the numerical wave of the data. Otherwise, data is returned in "wide" format with a column for each wave and variable. |
A tibble containing individual response data for the desired waves and variables.
1 2 3 4 5 | ## Not run:
get_ind_multiwave(dir="path/to/directory", waves=c(4, 10), vars="envhabit1")
get_ind_multiwave(dir="path/to/directory", waves=c(4, 10), vars=c("envhabit1", "envhabit2"), long=FALSE)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.