Skip to contents

Plot alignment scatterplot

Usage

plot_scatter_animated(
  data,
  data_level = c("company", "group_var"),
  sector = NULL,
  scenario_source = NULL,
  scenario = NULL,
  region = NULL,
  title = NULL,
  subtitle = NULL,
  alignment_limit = NULL,
  cap_outliers = NULL,
  floor_outliers = NULL
)

prep_scatter_animated(
  data_bopo,
  data_net,
  data_level = c("group_var", "company"),
  sector,
  region,
  group_var,
  groups_to_plot = NULL
)

Arguments

data

data.frame. Should have the same format as output of prep_scatter_animated() and contain columns: 'name', 'buildout', 'phaseout', 'net' and 'year'.

data_level

Character. Level of the plotted data. Can be 'group_var' or 'company'.

sector

Character. Sector to filter data on.

scenario_source

Character. Scenario source to be used in the plot caption.

scenario

Character. Scenario name to be used in the plot caption.

region

Character. Region to filter data on.

title

Character. Custom title if different than default.

subtitle

Character. Custom subtitle if different than default.

alignment_limit

Numeric. Limit to be applied to the x- and y-axis scales and to alignment values for colouring. By default the maximum absolute alignment value from data is used.

cap_outliers

Numeric. Cap which should be applied to the alignment values in the data. Values bigger than cap are plotted on the border of the plot.

floor_outliers

Numeric. Floor which should be applied to the alignment values in the data. Values smaller than floor are plotted on the border of the plot.

data_bopo

data.frame. Data containing buildout and phaseout alignment values. Must contain columns: 'year', 'sector', 'region', 'direction' and either 'name_abcd' and 'alignment_metric' or 'exposure_weighted_net_alignment' plus any column implied by group_var.

data_net

data.frame. Data containing net alignment values. Must contain columns: group_var, 'year', 'sector', 'region', 'direction' and either 'name_abcd' and 'alignment_metric' or 'exposure_weighted_net_alignment'.

group_var

Character. Vector of length 1. Variable to group by.

groups_to_plot

Character vector. Groups to filter on.

Value

object of type "plotly"

data.frame

Examples

# TODO