| Title: | Access Tidy Education Finance Data |
|---|---|
| Description: | Provides easy access to tidy education finance data using Bellwether's methodology to combine NCES F-33 Survey, Census Bureau Small Area Income Poverty Estimates (SAIPE), and community data from the ACS 5-Year Estimates. The package simplifies downloading, caching, and filtering education finance data by year and state, enabling researchers and analysts to explore K-12 education funding patterns, revenue sources, expenditure categories, and demographic factors across U.S. school districts. |
| Authors: | Alex Spurrier [aut, cre], Krista Kaput [aut], Michael Chrzan [ctb], Bellwether [cph] |
| Maintainer: | Alex Spurrier <[email protected]> |
| License: | CC BY 4.0 |
| Version: | 0.1.1.9000 |
| Built: | 2026-05-24 09:43:04 UTC |
| Source: | https://github.com/bellwetherorg/edfinr |
This function downloads tidy education finance data using data from the NCES F-33 Survey, Census Bureau Small Area Income Poverty Estimates (SAIPE), and community data from the ACS 5-Year Estimates.
get_finance_data( yr = "2022", geo = "all", dataset_type = "skinny", cpi_adj = "none", refresh = FALSE, quiet = FALSE )get_finance_data( yr = "2022", geo = "all", dataset_type = "skinny", cpi_adj = "none", refresh = FALSE, quiet = FALSE )
yr |
A string specifying the year(s) to retrieve. Can be a single year ("2022"), a range ("2020:2022"), or "all" for all available years. Defaults to "2022". |
geo |
A string specifying the geographic scope. Can be "all" for all states (default), a single state code ("KY"), or a comma-separated list of state codes ("IN,KY,OH,TN"). |
dataset_type |
A string specifying whether to download the "skinny" (default) or "full" dataset. The skinny version excludes detailed expenditure data for faster downloads. |
cpi_adj |
A string specifying the CPI adjustment baseline year. Can be "none" (default) for no adjustment, or a year between 2012-2022 to use as the baseline year. When a year is specified (e.g., "2022"), revenue, expenditure, and economic variables are adjusted to that school year's dollars using CPI averaged over the months of the school year (e.g., "2022" uses the 2021-22 school year CPI). When cpi_adj is set to a value other than "none", a new column "cpi_adj_index" will be added to the output showing the adjustment index used for each row. |
refresh |
A logical value indicating whether to force a refresh of the cached data. Default is FALSE. |
quiet |
A logical value indicating whether to suppress download progress messages. Default is FALSE. Note: Cache is stored in R's temporary directory and will be cleared when the R session ends. |
A tibble containing the requested education finance data.
# Check valid parameters without downloading get_states() # Valid state codes # These examples require internet access and may take time to download # get data for Kentucky for 2022 ky_data <- get_finance_data(yr = "2022", geo = "KY") # get data for multiple years ky_multi <- get_finance_data(yr = "2020:2022", geo = "KY") # get full dataset with detailed expenditure data ky_full <- get_finance_data(yr = "2022", geo = "KY", dataset_type = "full") # get data adjusted to 2022 dollars ky_adjusted <- get_finance_data(yr = "2020:2022", geo = "KY", cpi_adj = "2022") #' # get data for multiple states for all available years regional_data <- get_finance_data(yr = "all", geo = "IN,KY,OH,TN")# Check valid parameters without downloading get_states() # Valid state codes # These examples require internet access and may take time to download # get data for Kentucky for 2022 ky_data <- get_finance_data(yr = "2022", geo = "KY") # get data for multiple years ky_multi <- get_finance_data(yr = "2020:2022", geo = "KY") # get full dataset with detailed expenditure data ky_full <- get_finance_data(yr = "2022", geo = "KY", dataset_type = "full") # get data adjusted to 2022 dollars ky_adjusted <- get_finance_data(yr = "2020:2022", geo = "KY", cpi_adj = "2022") #' # get data for multiple states for all available years regional_data <- get_finance_data(yr = "all", geo = "IN,KY,OH,TN")
Returns the valid two-letter state codes that can be used with get_finance_data
get_states()get_states()
A character vector of state codes
# Get all valid state codes states <- get_states() head(states)# Get all valid state codes states <- get_states() head(states)
This function provides information about the variables available in the education finance dataset, including their names, types, and brief descriptions.
list_variables(dataset_type = "skinny", category = "all")list_variables(dataset_type = "skinny", category = "all")
dataset_type |
A string specifying whether to list variables for "skinny" (default) or "full" dataset. |
category |
Optional. Filter variables by category: "id", "time", "geographic", "demographic", "revenue", "expenditure", "economic", "governance", or "all" (default). |
A tibble with variable information
# list all available variables in skinny dataset vars <- list_variables() head(vars) # list all variables in full dataset full_vars <- list_variables(dataset_type = "full") nrow(full_vars) # list only expenditure variables in full dataset exp_vars <- list_variables(dataset_type = "full", category = "expenditure") head(exp_vars)# list all available variables in skinny dataset vars <- list_variables() head(vars) # list all variables in full dataset full_vars <- list_variables(dataset_type = "full") nrow(full_vars) # list only expenditure variables in full dataset exp_vars <- list_variables(dataset_type = "full", category = "expenditure") head(exp_vars)