pat_multiPlot: Display multiple plots on one page

Description Usage Arguments Value Note Examples

View source: R/pat_multiPlot.R

Description

A plotting function that uses ggplot2 to display multiple ggplot objects in a single pane. Can either be passed individual ggplot objects OR a pat object and a plot type. Typical usage would be to supply pat and use the plottype argument to quickly display preformatted plots.

Available plottype options include:

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
41
42
43
pat_multiPlot(
  pat = NULL,
  plottype = "all",
  sampleSize = 5000,
  columns = NULL,
  ylim = NULL,
  a_size = 1,
  a_shape = 15,
  a_color = rgb(0.9, 0.25, 0.2),
  b_size = 1,
  b_shape = 15,
  b_color = rgb(0.2, 0.25, 0.9),
  t_size = 1,
  t_shape = 15,
  t_color = "black",
  h_size = 1,
  h_shape = 15,
  h_color = "black",
  alpha = 0.5,
  timezone = NULL
)

pat_multiplot(
  pat = NULL,
  plottype = "all",
  sampleSize = 5000,
  columns = NULL,
  ylim = NULL,
  a_size = 1,
  a_shape = 15,
  a_color = rgb(0.9, 0.25, 0.2),
  b_size = 1,
  b_shape = 15,
  b_color = rgb(0.2, 0.25, 0.9),
  t_size = 1,
  t_shape = 15,
  t_color = "black",
  h_size = 1,
  h_shape = 15,
  h_color = "black",
  alpha = 0.5,
  timezone = NULL
)

Arguments

pat

PurpleAir Timeseries pat object.

plottype

Quick-reference plot types: "all", "aux", "pm25".

sampleSize

Either an integer or fraction to determine sample size.

columns

Number of columns in the plot layout. Use NULL for defaults.

ylim

Vector of (lo,hi) y-axis limits.

a_size

Size of pm25_A points.

a_shape

Symbol to use for pm25_A points.

a_color

Color of pm25_A points.

b_size

Size of pm25_B points.

b_shape

Symbol to use for pm25_B points.

b_color

Color of pm25_B points.

t_size

Size of temperature points.

t_shape

Symbol to use for temperature points.

t_color

Color of temperature points.

h_size

Size of humidity points.

h_shape

Symbol to use for humidity points.

h_color

Color of humidity points.

alpha

Opacity of points.

timezone

Olson timezone used for the time axis. (Defaults to pat local time.)

Value

A ggplot object.

Note

Additional documentation of the multiplot algorithm is available at cookbook-r.com.

Examples

1
2
3
4
library(AirSensor)

example_pat %>%
  pat_multiPlot(plottype = "pm25", alpha = 0.5)

AirSensor documentation built on March 13, 2021, 1:07 a.m.