gginput: gginput

View source: R/gginput.R

gginputR Documentation

gginput

Description

Converts a MAgPIE object into a dataframe usable for ggplot

Usage

gginput(data, scatter=NULL, mappings=NULL, na.rm=FALSE, verbose=TRUE)

Arguments

data

MAgPIE object which provides the data for ggplot

scatter

In the case you want to make a scatterplot you have to specify here which data dimension of the MAgPIE object should be used for the scatter plot (name of the dimension)

mappings

A list of mappings used to create combinations of columns which then can be used for aesthetics in ggplot

na.rm

Boolean which decides whether NA values should be removed from the data.

verbose

Boolean which decides whether info messages should be printed to screen or not.

Value

Dataframe usable for ggplot

Author(s)

Jan Philipp Dietrich

Examples

## Not run: 
library(ggplot2)
data(population_magpie)
ggplot(gginput(population_magpie,scatter="scenario"),aes(x=.value.A2,y=.value.B1,color=i)) 
+ geom_point() + geom_smooth(method="loess") + facet_wrap(~.spat1)

## End(Not run)

pik-piam/luplot documentation built on Jan. 29, 2025, 12:30 a.m.