iplotBar: Bar chart

Description Usage Arguments Value See Also Examples

View source: R/coin_resultsdash.R

Description

Generates an interactive bar chart. This function is simply a wrapper for the plotly bar chart function, but accesses the COIN object to get the relevant indicator. Also has click event data for Shiny. Allows construction of stacked bar charts which show underlying components (for aggregated data only), and plots of only specified groups.

Usage

1
2
3
4
5
6
7
8
9
iplotBar(
  COIN,
  dset = "Raw",
  isel = NULL,
  usel = NULL,
  aglev = NULL,
  stack_children = FALSE,
  from_group = NULL
)

Arguments

COIN

The COIN object, or a data frame of indicator data.

dset

The data set to plot.

isel

The selected indicator code or aggregate (does not support multiple indicators)

usel

A character vector of unit codes to highlight on the bar chart (optional)

aglev

The aggregation level to collect the indicator data from (this needs to be specified)

stack_children

If TRUE, produces a stacked bar chart with any children of isel. In this case, usel is ignored. This only works if dset = "Aggregated" and aglev > 1.

from_group

Filters the bar chart to a specified group using a group column that is present in the specified data set. Specified as list(group_variable = selected_group).

Value

Interactive bar chart generated by plotly.

See Also

Examples

1
2
3
4
# assemble ASEM COIN
ASEM <- assemble(IndData = ASEMIndData, IndMeta = ASEMIndMeta, AggMeta = ASEMAggMeta)
# plot Flights indicator
iplotBar(ASEM, dset = "Raw", isel = "Flights", aglev = 1)

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