Load multiple years of an IPEDS survey component
ipeds_load_series.RdRetrieve and load several years' worth of IPEDS data into a single dataframe. If not found on disk, files are downloaded from NCES using ipeds_download().
Usage
ipeds_load_series(
data_files,
data_dir = "ipeds",
read = ipeds_read_csv,
force = FALSE,
sleep_interval = 1
)Arguments
- data_files
character vector with basename (no suffix) of survey datafiles to retrieve. For example,
"HD2022"for the 2022 institutional characteristics survey, orc("EAP2020", "EAP2021")for the 2020--2021 Employees by Assigned Position surveys as a single table.- data_dir
directory to download and extract files to. Created if it doesn't exist.
- read
by default, files are read with
ipeds_read_csv(); if customized behavior is needed, supply a function which takes a filename and returns a data frame.- force
if
FALSE(default), files are not redownloaded or extracted if they already exist indata_dir.- sleep_interval
seconds to wait between download requests (if any are needed)
Value
a dataframe with all the survey data and an additional numeric column, year, derived from the filenames
See also
For a quick (but possibly outdated) reference of possible data files, see ipeds_surveys; ipeds_surveys$data_file gives the filenames to supply to data_files.
Examples
if (FALSE) {
eap <- ipeds_load_series(paste0("EAP", 2015:2021))
}