swoutput: swoutput

View source: R/swoutput.R

swoutputR Documentation

swoutput

Description

Creates LaTeX code for plot (magpie2ggplot2) and data table (print.xtable) based on MAgPIE objects and adds it to a "swStream" object.

Usage

swoutput(stream,data,unit="unit",plot=TRUE,table=TRUE,scenarioName="default",
textSize=16,digits=0,plotLevel=NULL,...)

Arguments

stream

The swStream object to be modified

data

MAgPIE object or list of MAgPIE objects. For a list of MAgPIE objects the name of the list entry (has to be character) is used as scenario name.

unit

unit of data (Character). Used as ylab in magpie2ggplot2 and table caption in print.xtable

plot

TRUE or FALSE. If TRUE, LaTeX code for plot (magpie2ggplot2) is added

table

TRUE or FALSE. If TRUE, LaTeX code for data table (print.xtable) is added

scenarioName

Name of the scenario. Only used if data is not a list.

textSize

Size of text used in magpie2ggplot2

digits

Number of digits for rounding. Used in xtable

plotLevel

NULL for all (default), reg or glo

...

Further options passed to magpie2ggplot2 and print.xtable

Details

Creates preformatted plots and data tables based on MAgPIE objects. Format is optimized for readability. Data tables with more than 12 columns are rescaled for fitting on portrait pages.

Value

No return value

Author(s)

Florian Humpenoeder

See Also

"swStream",swopen,swclose,swR,swtable,swfigure

Examples


## Not run: 
sw<-swopen("croparea_reg.pdf")
swlatex(sw,"\newpage")
swlatex(sw,"\section{Croparea - regional}")
swoutput(sw,croparea(gdx),"mio. ha",scenario="test")
swclose(sw)
## End(Not run)


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