raster_facet: Small multiples map of BlueSky model output

Description Usage Arguments Value Examples

View source: R/raster_facet.R

Description

This function creates a grid of plots, each displaying a small map of a single hour from the model output passed in as raster. By default, all hours are plotted. The index parameter can be used to subset the hours.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
raster_facet(
  raster,
  index = NULL,
  palette = "Greys",
  breaks = c(0, 12, 35, 55, 150, 250, 350, Inf),
  direction = 1,
  title = "",
  timezone = "UTC",
  ncol = NULL,
  col_state = "black",
  col_county = "gray80"
)

Arguments

raster

A Raster\* object.

index

Vector of indices used to subset raster

palette

Color palette used to map cell values. This must be either "aqi" or one of the palette names available through ggplot2::scale_colour_brewer().

breaks

The breaks used to map cell values to colors. (Unless palette = "aqi" in which case AQI breaks are used.)

direction

Numeric. direction = -1 reverses color palette.

title

(Optional) A plot title.

timezone

Olson timezone in which times will be displayed.

ncol

Number of columns in the output plot.

col_state

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

col_county

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

Value

A gg object.

Examples

 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
41
42
43
## Not run: 
library(AirFireModeling)
setModelDataDir('~/Data/BlueSky')

# Load model data
rasterList <- raster_load(
  modelName = "PNW-4km",
  modelRun = c(2020091300),
  xlim = c(-125, -117),
  ylim = c(42, 47)
)

# First 24 hours
raster_facet(
  rasterList[[1]],
  index = 1:24,
  col_county = 'transparent'
)

# Fancy!!
raster_facet(
  rasterList[[1]],
  index = seq(3,72,12),
  title = "PNW-4km -- run 2020091300",
  timezone = "America/Los_Angeles"
)

# Oregon Labor Day Fires
rasterList <- raster_load(
  modelName = "PNW-4km",
  modelRun = c(2020091300),
  xlim = c(-123.5, -121.5),
  ylim = c(44.0, 46.0)
)

raster_facet(
  rasterList[[1]],
  title = "Oregon Labor Day Fires",
  ncol = 12
)


## End(Not run)

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