Skip to contents

Reads the per-year xpath counts and filing counts that build_evidence() writes from the ef2 DuckDB builds (xpath_stats.csv and filings.csv), for one or more evidence directories: evidence (990 and 990-EZ returns) and evidence/pf (990-PF returns). These are the observations xpath_version_fields() uses.

To refresh them from new or rebuilt ef2 databases, run build_evidence() and combine_evidence() (see data-raw/build-evidence.R and data-raw/build-evidence-pf.R), then update_xpath_versions().

In the ef2 builds the tax year of a filing is the year of its schema version, so tax_year and the year of schema_version agree.

Usage

xpath_observations(evidence_dirs = c("evidence", file.path("evidence", "pf")))

Arguments

evidence_dirs

Evidence directories, each holding xpath_stats.csv and filings.csv.

Value

A list: xpaths (tax_year, xpath, schema_version, return_type, n_filings: filings whose return holds the xpath) and filings (tax_year, return_type, n_filings: all filings).