This article demonstrates some of the operations from the first steps tutorial from the pyam package, but from R.

knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)
library(pryam)
df <- pyam_data_frame(system.file("extdata", "pyam", "tutorial_data.csv", package = "pryam"))

Printing:

df

Index values:

df$model
df$scenario
df$scenario
df$region
df$variables(include_units = TRUE)

Apply filters to the ensemble and display the timeseries data

df$filter(model = "MESSAGE")$scenario
df$filter(model = "MESSAGE*")$scenario
df$filter(region = "World", keep = FALSE)$region

Filtering by variables and levels

df$filter(variable='Primary Energy*', level=1)$variable
df$filter(variable='Primary Energy*', level='1-')$variable

Visualize the timeseries data using the plotting library

r.df.filter(variable='Emissions|CO2', region='World').plot()


jameelalsalam/pryam documentation built on April 5, 2022, 7:43 a.m.