Skip to contents

A unified long-schema front door over the package's existing course, advanced-coursework, CTE, and college-career fetchers. This is additive: the source-specific fetchers keep their existing default outputs, while fetch_courses() delegates to them and normalizes published value columns onto a common metric/value schema.

Usage

fetch_courses(
  type = .course_fetch_types,
  end_year,
  level = "school",
  ...,
  with_status = FALSE,
  annotate = FALSE
)

Arguments

type

Course data family. See details for valid values.

end_year

A school year end, e.g. 2025 for SY2024-25.

level

One of "school" or "district", passed to the underlying fetcher.

...

Optional arguments for specific families. subject filters type = "course_enrollment"; test_type is passed to type = "sat_performance".

with_status

Logical, default FALSE. If TRUE, appends a value_status column classified from each raw published value token before numeric coercion in this dispatcher.

annotate

Logical, default FALSE. If TRUE, appends registry metadata via annotate_metric.

Value

A tibble with entity identifiers, optional dimensions such as subgroup, subgroup_std, course_subject, course_name, career_cluster, test_type, and apprenticeship_year, standard entity flags, metric, value, and optionally value_status. Metric names are designed for lookup with annotate_metric.

Details

The type argument maps to existing fetchers as follows:

Value columns are classified with classify_value_status before this dispatcher coerces them with spr_value_numeric. Suppressed or unpublished cells therefore stay honest NA values; no counts or rates are back-derived from another published cell.

Examples

if (FALSE) { # \dontrun{
fetch_courses("advanced_access", 2025)
fetch_courses("course_enrollment", 2024, subject = "science")
fetch_courses("cte", 2025, with_status = TRUE)
} # }