Package 'mrwaterplots'

Title: plotting library for mrwater outputs
Description: The mrwaterplots package plots outputs from mrwater library.
Authors: Felicitas Beier [aut, cre], Jens Heinke [aut], Patrick von Jeetze [aut], Jan Philipp Dietrich [aut]
Maintainer: Felicitas Beier <[email protected]>
License: LGPL-3 | file LICENSE
Version: 1.0.18
Built: 2024-12-19 05:39:09 UTC
Source: https://github.com/pik-piam/mrwaterplots

Help Index


mrwaterplots: plotting library for mrwater outputs

Description

The mrwaterplots package plots outputs from mrwater library.

Author(s)

Maintainer: Felicitas Beier [email protected]

Authors:

See Also

Useful links:


downloadNaturalEarth

Description

download Natural Earth shape files

Usage

downloadNaturalEarth()

Author(s)

Felicitas Beier

See Also

downloadSource()

Examples

## Not run: 
a <- downloadSource("NaturalEarth")

## End(Not run)

plotBivariateMap

Description

This function plots a raster object of halfdegree resolution (with 67420 grid cells) and saves it as PDF

Usage

plotBivariateMap(
  x,
  y,
  xlab = NULL,
  ylab = NULL,
  breaks = 4,
  projection =
    "+proj=eqearth +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs",
  bivariatelegendstyle = 1,
  colNA = "#d9d9d9",
  outputfolder = ".\\",
  name = "name",
  title = "",
  ylim = c(-6500000, 8300000),
  xlim = c(-12577316, 15581284),
  outputtype = "png"
)

Arguments

x

First MAgPIE object in grid-cellular (67420) resolution to be plotted

y

Second MAgPIE object in grid-cellular (67420) resolution to be plotted in same map

xlab

name of first object for legend x label

ylab

name of second object of legend y label

breaks

Breaks in bivariate legend

projection

Choose projection. Currently available options: "+proj=eqearth +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs" for EqualEarth projection; "+proj=robin +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs" for RobinsonProj; and "+proj=longlat +datum=WGS84" for LatLon projection

bivariatelegendstyle

number between 1-9 to choose pre-defined bivariate legend colors

colNA

color for NAs (default: "#d9d9d9" (gray))

outputfolder

Path to which plot should be saved

name

Title of plot (default: "name")

title

Plot title displayed in the plot

ylim

y-axis limits of plot (default: c(-6500000, 8300000))

xlim

x-axis limits of plot (default: c(-12577316, 15581284))

outputtype

Output type: pdf or jpeg

Value

map as pdf

Author(s)

Felicitas Beier


plotMap

Description

This function plots a raster object of halfdegree resolution (with 67420 grid cells) and saves it as PDF

Usage

plotMap(
  x,
  projection =
    "+proj=eqearth +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs",
  outputfolder = ".\\",
  name = "name",
  title = "",
  ylim = c(-6500000, 8300000),
  xlim = c(-12577316, 15581284),
  legendcolor = c("#7f0000", "#b30000", "#d7301f", "#ef6548", "#fc8d59", "#fdbb84",
    "#fdd49e", "#fee8c8", "#fff7ec", "#045a8d"),
  colNA = "#d9d9d9",
  legendlimit = c(0, 1),
  legendbreaks = seq(0, 1, 0.1),
  legendname = "legendname",
  outputtype = "png",
  minVal = NULL,
  maxVal = NULL
)

Arguments

x

MAgPIE object in grid-cellular (67420) resolution to be plotted

projection

Choose projection. Currently available options: "+proj=eqearth +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs" for EqualEarth projection; "+proj=robin +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs" for RobinsonProj; and "+proj=longlat +datum=WGS84" for LatLon projection

outputfolder

Path to which plot should be saved

name

Title of plot (default: "name")

title

Plot title displayed in the plot

ylim

y-axis limits of plot (default: c(-6500000, 8300000))

xlim

x-axis limits of plot (default: c(-12577316, 15581284))

legendcolor

vector of colors

colNA

color for NAs (default: "#d9d9d9" (gray))

legendlimit

vector with min and max of legend (default: c(0, 1))

legendbreaks

vector of legend breaks (default: seq(0, 1, 0.1))

legendname

legend name as character (default: "legendname")

outputtype

Output type: pdf or jpeg

minVal

minimum value at which x should be chopped

maxVal

maximum value at which x should be chopped

Value

map as pdf, jpg or png

Author(s)

Felicitas Beier, Jens Heinke


plotMapDiscrete

Description

This function plots a raster object of halfdegree resolution (with 67420 grid cells) and saves it as PDF

Usage

plotMapDiscrete(
  x,
  projection =
    "+proj=eqearth +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs",
  outputfolder = ".\\",
  name = "name",
  title = "",
  ylim = c(-6500000, 8300000),
  xlim = c(-12577316, 15581284),
  legendcolor = c("#7f0000", "#b30000", "#d7301f", "#ef6548", "#fc8d59", "#fdbb84",
    "#fdd49e", "#fee8c8", "#fff7ec", "#045a8d"),
  colNA = "#d9d9d9",
  legendbreaks = seq(0, 1, 0.1),
  legend = NULL,
  legendname = "legendname",
  outputtype = "png",
  minVal = NULL,
  maxVal = NULL
)

Arguments

x

MAgPIE object in grid-cellular (67420) resolution to be plotted

projection

Choose projection. Currently available options: "+proj=eqearth +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs" for EqualEarth projection; "+proj=robin +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs" for RobinsonProj; and "+proj=longlat +datum=WGS84" for LatLon projection

outputfolder

Path to which plot should be saved

name

Title of plot (default: "name")

title

Plot title displayed in the plot

ylim

y-axis limits of plot (default: c(-6500000, 8300000))

xlim

x-axis limits of plot (default: c(-12577316, 15581284))

legendcolor

vector of colors

colNA

color for NAs (default: "#d9d9d9" (gray))

legendbreaks

vector of legend breaks (default: seq(0, 1, 0.1))

legend

legend element names (if non-numeric characters shall be returned). (default: NULL, then legendbreaks defines displayed legend elements)

legendname

legend name as character (default: "legendname")

outputtype

Output type: pdf or jpeg

minVal

minimum value at which x should be chopped

maxVal

maximum value at which x should be chopped

Value

map as pdf, jpg or png

Author(s)

Felicitas Beier, Jens Heinke


toolCellAreaShare

Description

This function transforms a cellular magpie object with 67420 grid cells to an raster object that can be plotted in the chosen projection

Usage

toolCellAreaShare(x)

Arguments

x

MAgPIE object in grid-cellular (67420) resolution containing area in Mha for which cell area share is to be calculated

Value

magpie object in cellular resolution

Author(s)

Felicitas Beier


toolPrepareLandMask

Description

This function sets up the land mask and country polygons to plot magpie objects using raster/terra with an Equal Earth Projection

Usage

toolPrepareLandMask(
  projection =
    "+proj=eqearth +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs"
)

Arguments

projection

Choose projection. Currently available options: "+proj=eqearth +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs" for EqualEarth projection; "+proj=robin +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs" for RobinsonProj; and "+proj=longlat +datum=WGS84" for LatLon projection

Value

list of raster files

Author(s)

Felicitas Beier, Jens Heinke, Patrick v. Jeetze, Jan P. Dietrich


toolRasterTransform

Description

This function transforms a cellular magpie object with 67420 grid cells to a raster object that can be plotted in the chosen projection

Usage

toolRasterTransform(
  x,
  projection =
    "+proj=eqearth +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs"
)

Arguments

x

MAgPIE object in grid-cellular (67420) resolution to be transformed to raster

projection

Choose projection. Currently available options: "+proj=eqearth +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs" for EqualEarth projection; "+proj=robin +lon_0=0 +x_0=0 +y_0=0 +ellps=WGS84 +datum=WGS84 +units=m +no_defs" for RobinsonProj; "+proj=moll" for Mollweide; and "+proj=longlat +datum=WGS84" for LatLon projection

Value

magpie object in cellular resolution

Author(s)

Felicitas Beier