Skip to contents

Sample frame

Define a reusable specification of keys and typed rules, then apply it to, or validate it against, any data frame.

create_sfw()
Create a sample frame
add_key() get_keys()
Register a key on a sample frame
add_rule()
Add or replace a rule on a sample frame
update_rule() remove_rule() get_rules()
Update, drop, or list sample-frame rules
add_meta() set_policy() add_function() add_view() add_refresh()
Metadata, policies, and rule sugar for a sample frame
classify_panel()
Classify panel membership and store it as label rules
apply_sfw()
Apply a sample frame to a data frame
apply_check()
Run a sample frame's check rules
views()
Compute a sample frame's view rules against a data frame
conform()
Check whether a data frame conforms to a sample frame

The panel object

Bundle data with its sample frame; extract and report provenance.

as_panel() is_panel()
Bundle a data frame with a sample frame
panel_data() sample_frame()
Extract the data frame or sample frame from a panel
manifest()
Report a panel's provenance ledger

Acquire & assemble

Download, read, merge, and stack efile tables into a panel.

panelize()
Download, filter, merge, append BMF, and stack a panel
data_source()
Create an efile source configuration
table_catalog()
Catalog of canonical efile tables
resolve_tables()
Resolve aliases and literal efile table names
download_tables()
Download or reuse efile table CSV files
read_tables()
Read acquired efile CSV tables
merge_tables()
Merge efile tables using explicit filing keys

Organization traits (BMF)

Attach NCCS Business Master File fields by EIN.

bmf_merge()
Merge native BMF fields onto efile data
bmf_retrieve()
Retrieve and prepare the NCCS BMF master
bmf_prepare()
Prepare current-schema BMF data
bmf_url()
Return the current NCCS geocoded BMF master URL
bmf_vars()
Return the default native BMF fields

Normalize & clean

Form-aware normalization of source encodings and record deduplication.

concordance()
Construct a field-level data-normalization concordance
normalize()
Normalize efile source encodings using form-aware rules
panel_normalize()
Normalize blank financial fields to zero, form-scoped
financial_fields()
Core 990 financial fields
fields_in_scope()
Select efile fields by form scope
panel_deduplicate() deduplicate()
Select one filing per organization-year

Panel analysis

Classify, label, filter, impute, and smooth panels over time.

panel_describe()
Describe panel coverage and membership
panel_update()
Refresh panel-membership labels
panel_label()
Label rows with panel membership
panel_filter()
Select panel organizations by membership type
panel_balance()
Trim a panel to a balanced rectangle
panel_complete()
Complete panel spans by filling interior gaps
panel_impute()
Insert and fill missing panel years
panel_smooth()
Smooth numeric variables within panel IDs

Accounting consistency

Check and reconcile 990 rows against accounting identities.

accounting_check()
Check 990 rows against accounting identities
reconcile()
Reconcile 990 rows to accounting identities with the least change

Data

field_concordance
Field-scope and normalization concordance for IRS 990 efile variables
accounting_identities
Accounting-identity registry for IRS 990 financial fields