getResults: Results summary tables

Description Usage Arguments Details Value See Also Examples

View source: R/coin_resultstable.R

Description

Generates fast results tables, either attached to the COIN or as a data frame.

Usage

1
2
3
4
5
6
7
8
9
getResults(
  COIN,
  tab_type = "Summ",
  use = "scores",
  order_by = NULL,
  nround = 2,
  use_group = NULL,
  out2 = "df"
)

Arguments

COIN

The COIN object, or a data frame of indicator data

tab_type

The type of table to generate. Either "Summ" (a single indicator plus rank), "Aggs" (all aggregated scores/ranks above indicator level), or "Full" (all scores/ranks plus all group, denominator columns).

use

Either "scores" (default), "ranks", or "groupranks". For the latter, use_group must be specified.

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 use_group is specified, rows will also be sorted by the specified group.

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 use = "groupranks", ranks will be returned with respect to the groups in this column.

out2

If "df", outputs a data frame (tibble). Else if "COIN" attaches to .$Results in an updated COIN.

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.

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.

See Also

Examples

1
2
3
4
# build ASEM COIN up to aggregation
ASEM <- build_ASEM()
# results table of scores for index and aggregates (excluding indicator scores)
dfResults <- getResults(ASEM, tab_type = "Aggregates", out2 = "df")

COINr documentation built on Nov. 30, 2021, 9:06 a.m.