get_dset.coin {COINr}R Documentation

Gets a named data set and performs checks

Description

A helper function to retrieve a named data set from the coin object. Also performs input checks at the same time.

Usage

## S3 method for class 'coin'
get_dset(x, dset, also_get = NULL, ...)

Arguments

x

A coin class object

dset

A character string corresponding to a named data set within .$Data. E.g. "Raw".

also_get

A character vector specifying any columns to attach to the data set that are not indicators or aggregates. These will be e.g. uName, groups, denominators or columns labelled as "Other" in iMeta. These columns are stored in .$Meta$Unit to avoid repetition. Set also_get = "all" to attach all columns, or set also_get = "none" to return only numeric columns, i.e. no uCode column.

...

arguments passed to or from other methods.

Details

If also_get is not specified, this will return the indicator columns with the uCode identifiers in the first column. Optionally, also_get can be specified to attach other metadata columns, or to only return the numeric (indicator) columns with no identifiers. This latter option might be useful for e.g. examining correlations.

Value

Data frame of indicator data.

Examples

# build example coin, just up to raw dset for speed
coin <- build_example_coin(up_to = "new_coin", quietly = TRUE)

# retrieve raw data set with added cols
get_dset(coin, dset = "Raw", also_get = c("uName", "GDP_group"))


[Package COINr version 1.1.7 Index]