Description Usage Arguments Examples
View source: R/4rename_ind_vars.R
Renames all repeated variables in the Cross-year Individual file so that matching variables across waves have the same name, and transforms the resulting dataset into long format. The longitudinal file does not include rows for respondents who were missing in a given wave, and cross-sectional variables are marked as NA during waves when they were not asked. In addition, the resulting file adds two variables for ease of use: "Year" and "fam_id_68".
This function may require up to 8gb of RAM, and will likely throw "cannot allocate memory" errors to users with less RAM on their computer. Users with memory issues should implement the "only_long_vars" or "cust_vars" options.
1 2 | rename_ind_vars(in_direc, out_direc, only_long_vars = F,
cust_vars = NULL)
|
in_direc |
Directory of PSID Cross-year Individual file .rds file |
out_direc |
Directory for renamed and transformed PSID Cross-year Individual file to be saved to |
only_long_vars |
Keep only longitudinal variables in dataset |
cust_vars |
Custom variables to keep in dataset (as character vector). Output will always include "ER30001", "fam_id_68", and "Year" |
1 2 3 4 5 | rename_ind_vars(
only_long_vars=TRUE,
in_direc=system.file("extdata","rds_dir", package = "easyPSID"),
out_direc=tempdir()
)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.