validationPlot: validationPlot

Description Usage Arguments Value Author(s) See Also Examples

View source: R/validationPlot.R

Description

Function to create a validation plot from magpie outputs.

Usage

1
2
3
4
5
validationPlot(func, ..., historical=NULL, datasources=NULL, 
               years=NULL, xlim=NULL, ylim=NULL, index=FALSE,
               same_yscale=TRUE, text_size=15, title=NULL,
               legend_names=NULL, raw_plot=FALSE, 
               raw_legend=FALSE, withTL=FALSE)

Arguments

func

Name of the magpie library function that this data belongs to.

...

Values for arguments that func takes. If an argument is not specified the default value are used if existing. Otherwise an error will occur. The two arguments "file" and "level" can be omitted without causing problems.

historical

Determines what kind of data is returned. Either historical data (TRUE), projections (FALSE) or both (NULL).

datasources

A vector containing the names of the datasets that shall be returned. If NULL (default) all datasets are returned.

years

A vector specifying the first and last year displayed. Has to be provided as integer years, eg: years=c(1980,2045). For one sided limits, set the other one to NA, e.g. c(NA,2065) or c(1960,NA).

xlim

Similar to the years argument. For back compatibility only.

ylim

A vector specifying limits for the y axis.

index

Y axis diesplays absolute values (FALSE) or index wrt to model output in the first simulation year (TRUE)

same_yscale

If level=="reg", should all regions have the same y axis (TRUE) or individual ones (FALSE).

text_size

Size of the text in the plot

title

Title of the plot. If NULL, the title will be determined automatically from the comparison data.

legend_names

NULL or a vector of length three. Determines the legend titles for Model output, Historical data and Other projections. If NULL, the default titles will be used.

raw_plot

If FALSE, the complete plot is returned. If TRUE, a list with the actual plot, the legend and the function to combine both is returned. See histoPlot for details.

raw_legend

Works only with raw_plot=TRUE. If FALSE, the complete legend is returned. If TRUE, a list with the individual legend components and the function to combine both is returned. See histoPlot for details.

withTL

TRUE or FALSE. If TRUE, results of the trafficLight validation are displayed additionally.

Value

An object of the class ggplot is returned. Executing 'print' on it will show the plot. If raw_plot=TRUE, a list is returned (see histoPlot).

Author(s)

Markus Bonsch

See Also

addData,getData,histoPlot,addMapping,trafficLight

Examples

1
## Not run: print(validationPlot(func=land,gdx="fulldata.gdx",type="crop"),level="glo")

pik-piam/validation documentation built on Nov. 5, 2019, 12:50 a.m.