raster_ggmap: Geographic map of BlueSky model output

Description Usage Arguments Details Value Methods (by class) Examples

View source: R/raster_map.R

Description

Creates a ggplot2 plot object from a Raster\* object. The returned plot object can be plotted or can be enhanced with additional ggplot2 intructions.

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
28
29
30
31
32
33
34
35
36
37
38
39
40
raster_ggmap(
  raster,
  index = 1,
  palette = "Greys",
  breaks = c(0, 12, 35, 55, 150, 250, 350, Inf),
  direction = 1,
  title = "PM2.5",
  timezone = "UTC",
  col_state = "black",
  col_county = "gray80",
  verbose = TRUE
)

## S3 method for class 'Raster'
raster_ggmap(
  raster,
  index = 1,
  palette = "Greys",
  breaks = c(0, 12, 35, 55, 150, 250, 350, Inf),
  direction = 1,
  title = "PM2.5",
  timezone = "UTC",
  col_state = "black",
  col_county = "gray80",
  verbose = TRUE
)

## S3 method for class 'list'
raster_ggmap(
  raster,
  index = 1,
  palette = "Greys",
  breaks = c(0, 12, 35, 55, 150, 250, 350, Inf),
  direction = 1,
  title = "PM2.5",
  timezone = "UTC",
  col_state = "black",
  col_county = "gray80",
  verbose = TRUE
)

Arguments

raster

A Raster\* object or a list of Raster\* objects.

index

And index into the Raster\* object. See details.

palette

The color palette used to map cell values. This must be one of the palettes available through ggplot2::scale_colour_brewer().

breaks

The breaks used to map cell values to colors.

direction

Numeric. direction = -1 reverses color palette.

title

(Optional) A plot title.

timezone

Olson timezone in which times will be displayed.

col_state

Color of state lines. (use 'transparent' to hide them.)

col_county

Color of county lines. (use 'transparent' to hide them.)

verbose

Logical to display messages.

Details

If a list of Raster\* objects is provided, a small-multiples plot is created.

The index is typically associated with a time-axis or RasterLayer, e.g index = 1 is the first hour of a model.

Value

A ggplot object.

Methods (by class)

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
library(AirFireModeling)
setModelDataDir('~/Data/BlueSky')

# Load model data
rasterList <- raster_load(
  modelName = "PNW-4km",
  modelRun = c(2020091300, 2020091400, 2020091500, 2020091600),
  xlim = c(-125, -115),
  ylim = c(42, 50)
)

raster_ggmap(rasterList, title="PNW-4km", index = 3)

MazamaScience/AirFireModeling documentation built on March 13, 2021, 12:02 a.m.