split_variable_into_positive_and_negative_parts {mipplot}R Documentation

Split variable into positive and negative parts

Description

Generally, the range of the input value of stacked chart is greater than or equal to zero. This function splits variable into positive and negative parts in order to include negative values to stacked chart.

Usage

split_variable_into_positive_and_negative_parts(
  df_all,
  domain_column_name,
  variable_column_name,
  value_column_name,
  variable_name_converter = function(x) {     paste(x, "_negative", sep = "") },
  increment_of_domain_in_interpolation = 0.1
)

Arguments

df_all

input data frame

domain_column_name

domain column name, such as year

variable_column_name

variable column name, such as 'coal'

value_column_name

value column name, such as 'val'

variable_name_converter

function which convert original variable name into its negative part name

increment_of_domain_in_interpolation

step size for interpolation

Value

modified data frame


[Package mipplot version 0.3.1 Index]