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.
2025for SY2024-25.- level
One of
"school"or"district", passed to the underlying fetcher.- ...
Optional arguments for specific families.
subjectfilterstype = "course_enrollment";test_typeis passed totype = "sat_performance".- with_status
Logical, default
FALSE. IfTRUE, appends avalue_statuscolumn classified from each raw published value token before numeric coercion in this dispatcher.- annotate
Logical, default
FALSE. IfTRUE, appends registry metadata viaannotate_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:
"advanced_access"–fetch_advanced_course_accesswithtype = "participation_by_group"."courses_offered"–fetch_advanced_course_accesswithtype = "courses_offered"."dual_enrollment"–fetch_advanced_course_accesswithtype = "participation_by_group", keeping the dual-enrollment rate metrics."sle"–fetch_advanced_course_accesswithtype = "sle"."ap_ib_participation"–fetch_ap_participation."course_enrollment"– one or more course-enrollment fetchers:fetch_math_course_enrollment,fetch_science_course_enrollment,fetch_social_studies_enrollment,fetch_world_language_enrollment,fetch_cs_enrollment, andfetch_arts_enrollment. Usesubject =in...to keep one or more subjects; omitted means all subjects."cte"–fetch_cte_participation."industry_credentials"–fetch_industry_credentials."work_based_learning"–fetch_work_based_learning."apprenticeship"–fetch_apprenticeship_data."sat_participation"–fetch_sat_participation."sat_performance"–fetch_sat_performance; passtest_type =through...to filter."college_career"– stacks"sat_participation","sat_performance","ap_ib_participation","cte","industry_credentials","work_based_learning", and"apprenticeship".
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.