Select years and variables from the EPI CPS microdata extracts. These data must first be downloaded using download_cps() or from https://microdata.epi.org.

load_cps(.sample, .years, ..., .extracts_dir = NULL, .version_check = TRUE)

load_basic(.years, ..., .extracts_dir = NULL, .version_check = TRUE)

load_may(.years, ..., .extracts_dir = NULL, .version_check = TRUE)

load_org(.years, ..., .extracts_dir = NULL, .version_check = TRUE)

load_org_sample(.years, ..., .extracts_dir = NULL, .version_check = TRUE)

Arguments

.sample

CPS sample ("org", "basic", "march", "may")

.years

years of CPS data (integers)

...

tidy selection of variables to keep

.extracts_dir

directory where EPI extracts are

.version_check

when TRUE, confirm data are same version

Value

A tibble of CPS microdata

Details

All columns are selected if ... is missing.

.extracts_dir is required, but if NULL it will look for the environment variables

EPIEXTRACTS_CPSBASIC_DIR
EPIEXTRACTS_CPSORG_DIR
EPIEXTRACTS_CPSMAY_DIR

which could be set in your .Renviron, for example.

Functions

  • load_cps(): base function group

  • load_basic(): Load CPS Basic Monthly files

  • load_may(): Load CPS May files

  • load_org(): Load CPS ORG files

  • load_org_sample(): Load a demonstration sample of CPS ORG files; only useful for examples

Examples

if (FALSE) { # \dontrun{
# Load all of the 2019-2020 CPS Basic columns
load_basic(2019:2020)

# Load a selection of 2010-2019 CPS ORG columns:
load_org(2010:2019, year, month, orgwgt, female, wage)

# These are equivalent:
load_org(2019:2020)
load_cps("org", 2019:2020)
} # }