Import raw 990 governance fields via the panel990 package
Source:R/get-data.R
get_governance_data.RdBuilds the input to get_features from the IRS efile archive
using the
panel990
package. It assembles a sample frame that restricts the data to full 990
filers (RETURN_TYPE == "990"; the governance index does not apply to
990EZ returns, which omit these fields), then calls
panel990::panelize() to download the required tables, keep the needed
columns, and merge them into one row per filing.
Usage
get_governance_data(
years,
eins = NULL,
source = NULL,
cache = c("temporary", "retain"),
path = "efdata",
verbose = FALSE
)Arguments
- years
Integer vector of tax years to import.
- eins
Optional character vector of formatted EINs (
EIN2, e.g."EIN-43-2031361") to restrict the download to given organizations.- source
A
panel990::data_source()configuration. Defaults to the NCCS efile v2.1 archive. Pointrootat a local directory to read already-downloaded tables.- cache
Passed to
panel990::panelize():"temporary"(default) uses a session temp directory;"retain"keeps a durable cache inpath.- path
Cache directory used when
cache = "retain".- verbose
Print panel990 progress messages.
Value
A data.frame with one row per full-990 filing: ORG_EIN, the
raw governance fields, and identifier columns, ready for
get_features.
Details
The governance and management fields come from four tables:
F9-P04-T00-REQUIRED-SCHEDULESPart IV – required-schedule triggers (audited financials, interested-person transactions, non-cash and art/historical contributions).
F9-P06-T00-GOVERNANCEPart VI – governing body composition and governance/management policies and disclosures.
F9-P12-T00-FINANCIAL-REPORTINGPart XII – accounting method and audit oversight.
SM-P01-T00-NONCASH-CONTRIBUTIONSSchedule M – non-cash contribution review process.
The tables are imported raw and handed to get_features, which
performs the governance-specific normalization.
panel990::panel_normalize() only rewrites blank financial fields and
leaves these checkbox and count fields untouched, so it is safe (but
unnecessary) to apply beforehand.
Install panel990 with
remotes::install_github("Nonprofit-Open-Data-Collective/panel990").
See also
get_features, get_scores,
get_governance_scores;
panel990::panelize() and panel990::create_sfw() for the
underlying sample-frame workflow.
Examples
if (FALSE) { # \dontrun{
dat <- get_governance_data(years = 2022)
features <- get_features(dat)
scores <- get_scores(features)
} # }