get_data.purse {COINr} | R Documentation |
Get subsets of indicator data
Description
This retrieves data from a purse. It functions in a similar way to get_data.coin()
but has the
additional Time
argument to allow selection based on the point(s) in time.
Usage
## S3 method for class 'purse'
get_data(
x,
dset,
iCodes = NULL,
Level = NULL,
uCodes = NULL,
use_group = NULL,
Time = NULL,
also_get = NULL,
...
)
Arguments
x |
A purse class object |
dset |
The name of the data set to apply the function to, which should be accessible in |
iCodes |
Optional indicator codes to retrieve. If |
Level |
Optionally, the level in the hierarchy to extract data from. See details. |
uCodes |
Optional unit codes to filter rows of the resulting data set. Can also be used in conjunction with groups. See details. |
use_group |
Optional group to filter rows of the data set. Specified as |
Time |
Optional time index to extract from a subset of the coins present in the purse. Should be a
vector containing one or more entries in |
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. |
... |
arguments passed to or from other methods. |
Details
Note that
Value
A data frame of indicator data indexed by a "Time" column.
Examples
# build full example purse
purse <- build_example_purse(up_to = "new_coin", quietly = TRUE)
# get specified indicators for specific years, for specified units
get_data(purse, dset = "Raw",
iCodes = c("Lang", "Forest"),
uCodes = c("AUT", "CHN", "DNK"),
Time = c(2019, 2020))