add_codes_for_field: Extract the codes for a given field and add them to the given...

Description Usage Arguments Value

View source: R/extract.R

Description

add_codes_for_field adds a column containing the codes for a given field to the dataframes contained in the given results. The codes are derived from the uris: specifically they are the last item in uri string delimited with a colon. Where fields contain items for totals their uris do not contain a corresponding uri for the total. This function handles that case by creating a dummy code for the total (called "Total").

Usage

1
add_codes_for_field(results, field, colname)

Arguments

results

The results list.

field

The name of the field for which to extract codes.

colname

The name of the new column which will contain the codes.

Value

A copy of the results with a code column added to each dataframe.


houseofcommonslibrary/statxplorer documentation built on Sept. 13, 2020, 12:14 a.m.