make_res: Use the full dataset from prep_data diagram linking processes...

View source: R/network_analysis.R

make_resR Documentation

Use the full dataset from prep_data diagram linking processes with commodities shown as flows. Flow magnitude information is not included. The RES is shown for an individual specified period and sector. The nodes are labelled with process_description. This will be changed to an option

Description

Use the full dataset from prep_data diagram linking processes with commodities shown as flows. Flow magnitude information is not included. The RES is shown for an individual specified period and sector. The nodes are labelled with process_description. This will be changed to an option

Usage

make_res(
  dat,
  node_labels = process_description,
  edge_labels = commodity_description,
  sankey_width = NULL,
  sankey_height = NULL,
  font_size = 10,
  use_weights = T,
  input_data_type = "vd"
)

Arguments

dat

Tibble output from prep_data() %>% define_sector_from_*().

node_labels

Column in dat for labelling nodes.

edge_labels

Column in dat for labelling edges.

sankey_width

Width (in pixels) of sankey.

sankey_height

Height (in pixels) of sankey.

font_size

Numeric. Font size for RES labels.

use_weights

Logical. Whether to represent edge weights in Sankey that contains data for a single period. For data containing more than 1 period, magnitudes are unitary.

input_data_type

Character. "vd" or "vdt"

Value

NetworkD3 Sankey object

Examples

 data(demos_001_sector)
 demos_001_sector %>%
    make_res(period_select = 2005, sector_select = "coal",
             node_labels = process_description,
             edge_labels = commodity_description,
             font_size = 11)

 data(demos_001_vdt)
 make_res(demos_001_vdt %>%
             filter(region == "reg1"),
         input_data_type = "vdt")


DataScienceScotland/vedar documentation built on April 3, 2022, 10:32 p.m.