This function retrieves a table of available Current Population Survey (CPS) Basic variables for a given year and month. It scrapes the data from the official Census API webpage.

cps_var_table(year = "2023", month = "jan")

Arguments

year

Character string specifying the desired year (default is "2023").

month

A character string specifying the desired month (default is "jan"). It can be provided in lowercase three-letter format (e.g., "jan", "feb", etc.), as a full month name in any case (e.g., "January", "JANUARY", "january"), or as a numeric value (1 for January, 2 for February, etc.).

Value

A data frame containing the table of available CPS Basic variables for the specified year and month.

See also

[Census API Documentation](https://api.census.gov/data/)

Examples

if (FALSE) {
  cps_data <- cps_var_table(year = "2021", month = "apr")
  head(cps_data)
}