get_dset.coin {COINr}R Documentation

Gets a named data set and performs checks


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


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



A coin class object


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


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.


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.


Data frame of indicator data.


# 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.14 Index]