plot.stData: Plot stData objects

Description Usage Arguments Value Examples

View source: R/plot.stData.R

Description

This function provides basic plotting for telefit package data.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
## S3 method for class 'stData'
plot(
  x,
  type = "response",
  t = NULL,
  p = NULL,
  map = "world",
  region = ".",
  coord.s = NULL,
  coord.r = NULL,
  zlim = NULL,
  fill.lab = NULL,
  lab.teleconnection = expression(alpha),
  fill.lab.width = 20,
  category.breaks = NULL,
  coords.knots = NULL,
  signif.telecon = F,
  dots = NULL,
  pattern = 1,
  lwd = 1.75,
  cutoff = 0.9,
  signif.level = 0.05,
  alpha = 0.2,
  zmid = 0,
  contour = c(F, F),
  ...
)

Arguments

x

Object of class stData to plot.

type

One of the following options to specify what type of plot to build

response
sd.response

Plot standard deviation of response variable at each location.

cat.response
covariate
remote
teleconnection

This plot only applies if the stData object contains information about teleconnection effects, i.e., if it is a simulated dataset or otherwise modified to include estimates of teleconnection effects.

remote_cor

This plot shows pointwise correlations between a local coordinate and the remote covariates.

eof
eof_scores
eof_scree
eof_cor

This plot shows pointwise correlations with EOF patterns.

local_cor

This plot shows pointwise correlations with local covariates.

teleconnection_knot_local
t

timepoint to plot. Will automatically plot the first timepoint if t=NULL.

p

column index of local covariate to plot if type='covariate'. Will automatically assume the local covariate data includes an intercept and will plot the second column if p=NULL.

map

name of map provided by the maps package. These include county, france, italy, nz, state, usa, world, world2. By default, all stData plots will include us state outlines.

region

name of subregions to include. Defaults to . which includes all subregions. See documentation for map for more details.

coord.s

if plot type is 'teleconnection', specifies the longitude and latitude of local coordinate for which to plot teleconnection effects. if NULL, the middle local coordinate will be plotted.

coord.r

if plot type is 'teleconnection_local', specifes the longitude and latitude of remote coordinate for which to plot associated teleconnection effects. if NULL, the middle remote coordinate will be plotted.

zlim

c(min, max) vector that specifies the colorscale limits

fill.lab

Optional label to override the default fill scale labels

lab.teleconnection

label used for fill scale in teleconnection plot

fill.lab.width

line width for fill scale label

category.breaks

[ncoords x ncats] list of breakpoints used for binning responses into categories

coords.knots

if plot type is 'remote', specifies the longitude and latitude of knot locations to overlay on the 'remote' plot

signif.telecon

if TRUE, will highlight significant grid cells if the plotting data contain a signif column

dots

additional named arguments with defaults to pass to additional functions

pattern

if type=='eof' this specifies which (remote) EOF pattern to plot or if type=='eof_scores' this (vector) specifies which (remote) EOF pattern scores to plot

lwd

line width for when plotting with signif.telecon==T

cutoff

Used to denote where this proportion of variance is achieved in the eof_scree plots

signif.level

significance level for eof_cor significance highlighting

alpha

the level of fading that should be applied to insignificant grid boxes when plotting significant effects

zmid

number that specifies the midpoint of the colorscale

contour

c(TRUE, TRUE) to plot local and remote responses as contours vs. observations

...

additional arguments to pass to functions

Value

a ggplot object with the specified map

Examples

1
2
data("coprecip")
p = plot(coprecip)

jmhewitt/telefit documentation built on Feb. 9, 2020, 7:15 p.m.