Learn R Programming

amber (version 1.0.3)

plotHovmoeller: Plot Hovmoeller diagrams that show monthly climatological mean values and biases

Description

This function plots Hovmoeller diagrams of monthly climatological mean values and biases computed by scores.grid.time.

Usage

plotHovmoeller(plot.me, long.name, mod.id, ref.id, myBin = 20,
  gridCellWidth = 2, plot.width = 4, plot.height = 5.2,
  my.ylim = c(-100, 100), outputDir = FALSE)

Arguments

plot.me

A list that is produced by scores.grid.time

long.name

A string that gives the full name of the variable, e.g. 'Gross primary productivity'

mod.id

A string that identifies the source of the reference data set, e.g. 'CLASSIC'

ref.id

A string that identifies the source of the reference data set, e.g. 'MODIS'

myBin

An integer number that defines the latitudinal range used for computing the zonal mean. For instance, a value of 10 implies that a zonal mean is computed for every 10 degrees latitude.

gridCellWidth

A number that is used as a factor to adjust the width of grid cells, e.g. 1.

plot.width

Number that gives the plot width, e.g. 8

plot.height

Number that gives the plot height, e.g. 8

my.ylim

An R object with the latitudinal range that should be plotted, e.g. c(-40, 65).

outputDir

A string that gives the output directory, e.g. '/home/project/study'. The output will only be written if the user specifies an output directory.

Value

Figures in PDF format.

Examples

Run this code
# NOT RUN {
# }
# NOT RUN {
# Global plots on a regular grid

library(amber)
library(classInt)
library(doParallel)
library(foreach)
library(Hmisc)
library(latex2exp)
library(ncdf4)
library(parallel)
library(raster)
library(rgdal)
library(rgeos)
library(scico)
library(sp)
library(stats)
library(utils)
library(viridis)
library(xtable)

long.name <- 'Gross primary productivity'
nc.mod <- system.file('extdata/modelRegular', 'gpp_monthly.nc', package = 'amber')
nc.ref <- system.file('extdata/referenceRegular', 'gpp_GBAF_128x64.nc', package = 'amber')
mod.id <- 'CLASSIC' # define a model experiment ID
ref.id <- 'GBAF' # give reference dataset a name
unit.conv.mod <- 86400*1000 # optional unit conversion for model data
unit.conv.ref <- 86400*1000 # optional unit conversion for reference data
variable.unit <- 'gC m$^{-2}$ day$^{-1}$' # unit after conversion (LaTeX notation)

# Short version using default settings:
plot.me <- scores.grid.time(long.name, nc.mod, nc.ref, mod.id, ref.id, unit.conv.mod,
unit.conv.ref, variable.unit)
plotHovmoeller(plot.me, long.name, mod.id, ref.id)

# }
# NOT RUN {
 #donttest
# }

Run the code above in your browser using DataLab