Learn R Programming

R mipplot package

Purpose and Functionality

The mipplot package contains generic functions to produce area/bar/box/line plots of data following the IAMC submission format. The tool can be applied to datasets from climate mitigation scenarios (also known as emission scenarios) generated by means of integrated assessment models (IAM) and energy-economic models, that follow the format adopted for data submissions contributing to IPCC (Intergovernmental Panel on Climate Change) assessment reports. See the extended manual for details.

Installation

Windows

The latest release of mipplot can be installed from a binary package.

  1. Visit the release page on GitHub.

  2. Download the latest zip file (binary package).

  3. Start R.

  4. Set working directory to where the downloaded file is in.

  5. Run following commands.

if (!require("tidyverse")) install.packages("tidyverse")
if (!require("showtext")) install.packages("showtext")
if (!require("shiny")) install.packages("shiny")
if (!require("shinyWidgets")) install.packages("shinyWidgets")
if (!require("data.table")) install.packages("data.table")
if (!require("openxlsx")) install.packages("openxlsx")
if (!require("shiny.i18n")) install.packages("shiny.i18n")
if (!require("shinyalert")) install.packages("shinyalert")
install.packages("mipplot_0.3.0.zip", repos = NULL)

Or via devtools:

if (!require("devtools")) install.packages("devtools")
library(devtools)
devtools::install_github("UTokyo-mip/mipplot", dependencies = TRUE)

Mac OS

The latest release of mipplot can be installed from a binary package.

  1. Visit the release page on GitHub.

  2. Download the latest tar.gz file (source package).

  3. Start R.

  4. Set working directory to where the downloaded file is in.

  5. Run following commands.

if (!require("tidyverse")) install.packages("tidyverse")
if (!require("showtext")) install.packages("showtext")
if (!require("shiny")) install.packages("shiny")
if (!require("shinyWidgets")) install.packages("shinyWidgets")
if (!require("data.table")) install.packages("data.table")
if (!require("openxlsx")) install.packages("openxlsx")
if (!require("shiny.i18n")) install.packages("shiny.i18n")
if (!require("shinyalert")) install.packages("shinyalert")
install.packages("mipplot_0.3.0.tar.gz", repos = NULL)

Or via devtools:

if (!require("devtools")) install.packages("devtools")
library(devtools)
devtools::install_github("UTokyo-mip/mipplot", dependencies = TRUE)

Ubuntu (or Debian based distribution)

Run the following commands:

sudo apt install build-essential gfortran g++ libcurl4-openssl-dev libxml2-dev libssl-dev

This commands install the library which tidyverse library depends.

The latest release of mipplot can be installed from a tarball.

  1. Visit the release page on GitHub.

  2. Download the latest tar.gz file (source package).

  3. Start R.

  4. Set working directory to where the downloaded file is in.

  5. Run following commands.

if (!require("tidyverse")) install.packages("tidyverse")
if (!require("showtext")) install.packages("showtext")
if (!require("shiny")) install.packages("shiny")
if (!require("shinyWidgets")) install.packages("shinyWidgets")
if (!require("data.table")) install.packages("data.table")
if (!require("openxlsx")) install.packages("openxlsx")
if (!require("shiny.i18n")) install.packages("shiny.i18n")
if (!require("shinyalert")) install.packages("shinyalert")
install.packages("mipplot_0.3.0.tar.gz", repos = NULL)

Or via devtools:

if (!require("devtools")) install.packages("devtools")
library(devtools)
devtools::install_github("UTokyo-mip/mipplot", dependencies = TRUE)

Example

library(mipplot)
mipplot_area(ar5_db_sample_data, ar5_db_sample_rule_table,
  region = "World", scenario = "EMF27-450-FullTech")

Questions / Problems

In case of questions / problems please contact Diego Silva Herran silva-herran@iges.or.jp.

Screenshots

License

The mipplot R package is open source licensed under the MIT license.

Thanks

  • SNEH DESHPANDE and KEITARO HANZAWA for implementing the mipplot_return_table function

Copy Link

Version

Install

install.packages('mipplot')

Monthly Downloads

268

Version

0.3.1

License

MIT + file LICENSE

Maintainer

Akimitsu Inoue

Last Published

May 18th, 2021

Functions in mipplot (0.3.1)

get_variable_group_name_list

Get variable-group-name list
mipplot_area

Area plot from IAMC data
mipplot_additivity_check_bar

Additivity check using bar plot
mipplot_default_color_palette

Default color palette.
mipplot_box

Box plot from IAMC data
mipplot_interactive_plot_line

A function to launch interactive plot using Shiny
correct_format_of_iamc_dataframe

correct data format of given IAMC data table
get_string_expression_of_vector_of_strings

Get expression of vector of string in string format
get_scenario_name_list

Get name list of scenarios in IAMC formatted data frame
mipplot_interactive_line

A function to launch interactive plot using Shiny
mipplot_line

Line plot from IAMC data
get_variable_name_list_in_variable_group

Get variable name list in given variable-group
mipplot

mipplot
mipplot_point

Point plot from IAMC data
generate_code_to_plot_line

generate code to reproduce line plot
get_model_name_list

Get name list of models in IAMC formatted data frame
sr15_sample_conversion_rule_table

Sample Conversion Rule Table
split_variable_into_positive_and_negative_parts

Split variable into positive and negative parts
mipplot_autofill_color

Complementation of color scheme
mipplot_read_ruletab

Read file of rule table without ID number
mipplot_bar

Bar plot from IAMC data
mipplot_return_table

Mutated table of SR15 Data
mipplot_additivity_check

check additivity of rules and data
mipplot_generate_color_mapper

Manual coloring
mipplot_var_submission

variable SUBMISSION CHECK
mipplot_interactive_additivity_check_bar

A function to launch interactive plot using Shiny
mipplot_interactive_area

A function to launch interactive plotting session on Shiny
mipplot_print_pdf

Print list of plots to pdf file
mipplot_interactive_bar

A function to launch interactive plot using Shiny
read_iamc_xlsx

Read IAMC scenario input data in Excel format
mipplot_read_iamc

Read IAMC scenario input data.
sr15_sample_data

Sample Dataset
check_column_availability

check if the dataset has required fields of IAMC dataset
generate_code_to_plot_bar

generate code to reproduce bar plot
add_credit_to_plot

Add credit text to a plot
ar5_db_sample_rule_table

Sample Rule Table
generate_code_to_plot_area

generate code to reproduce area plot
change_data_types_of_iamc_dataframe

change column data type in data-set
add_credit_to_list_of_plot

Add credit text to plots
check_format_of_iamc_dataframe

check if the format of given data is valid as an IAMC dataset.
ar5_db_sample_data

Sample Dataset