R/data.R

Defines functions erri_example_data

Documented in erri_example_data

#' Example regional economic data
#'
#' Reads the reproducible example data installed with the package. The data
#' contain annual real-income indices for three fictional regions from 2010
#' through 2025, with a disruption beginning in 2020 and heterogeneous
#' recovery paths.
#'
#' @return A data frame with `region`, `year`, and `income`.
#' @export
#' @examples
#' dat <- erri_example_data()
#' head(dat)
erri_example_data <- function() {
    path <- system.file("extdata", "regional_economy.csv", package = "ERRI")
    if (!nzchar(path)) .erri_stop("Example data file was not installed.")
    utils::read.csv(path, stringsAsFactors = FALSE)
}

Try the ERRI package in your browser

Any scripts or data that you put into this service are public.

ERRI documentation built on Sept. 28, 2026, 5:08 p.m.