get_results {COINr} | R Documentation |
Results summary tables
Description
Generates fast results tables, either attached to the coin or as a data frame.
Usage
get_results(
coin,
dset,
tab_type = "Summ",
also_get = NULL,
use = "scores",
order_by = NULL,
nround = 2,
use_group = NULL,
dset_indicators = NULL,
out2 = "df"
)
Arguments
coin |
The coin object, or a data frame of indicator data |
dset |
Name of data set in |
tab_type |
The type of table to generate. Either |
also_get |
Names of further columns to attach to table. |
use |
Either |
order_by |
A code of the indicator or aggregate to sort the table by. If not specified, defaults to the highest
aggregate level, i.e. the index in most cases. If |
nround |
The number of decimal places to round numerical values to. Defaults to 2. |
use_group |
An optional grouping variable. If specified, the results table includes this group column,
and if |
dset_indicators |
Optional data set from which to take only indicator (level 1) data from. This can be set to |
out2 |
If |
Details
Although results are available in a coin in .$Data
, the format makes it difficult to quickly present results. This function
generates results tables that are suitable for immediate presentation, i.e. sorted by index or other indicators, and only including
relevant columns. Scores are also rounded by default, and there is the option to present scores or ranks.
See also vignette("results")
for more info.
This function replaces the now-defunct getResults()
from COINr < v1.0.
Value
If out2 = "df"
, the results table is returned as a data frame. If out2 = "coin"
, this function returns an updated
coin with the results table attached to .$Results
.
Examples
# build full example coin
coin <- build_example_coin(quietly = TRUE)
# get results table
df_results <- get_results(coin, dset = "Aggregated", tab_type = "Aggs")
head(df_results)