Learn R Programming

sspm (version 1.1.0)

plot: Plot sspm objects

Description

Plot methods for a range of sspm objects.

Usage

# S4 method for sspm_boundary,missing
plot(x, y, ...)

# S4 method for sspm_dataset,missing plot( x, y, ..., var = NULL, point_size = 1, line_size = 1, use_sf = FALSE, interval = FALSE, page = "first", nrow = 2, ncol = 2, log = FALSE, scales = "fixed", show_PI = TRUE, show_CI = TRUE )

# S4 method for sspm_fit,missing plot( x, y, ..., point_size = 1, line_size = 1, train_test = FALSE, biomass = NULL, next_ts = FALSE, smoothed_biomass = FALSE, aggregate = FALSE, interval = FALSE, biomass_origin = NULL, use_sf = FALSE, page = "first", nrow = 2, ncol = 2, log = FALSE, scales = "fixed", show_PI = TRUE, show_CI = TRUE )

Value

A ggplot2 plot object.

Arguments

x

[sspm_...] An object from this package.

y

NOT USED (from generic).

...

NOT USED (from generic).

var

[character] (For sspm_dataset) Variable to plot.

point_size

[numeric] Passed on to ggplot size parameter for point size.

line_size

[numeric] Passed on to ggplot size parameter for line size.

use_sf

[logical] Whether to produce a spatial plot.

interval

[logical] (For sspm_fit & sspm_dataset) Whether to plot CI and PI intervals.

page

The page to draw

nrow

Number of rows per page

ncol

Number of columns per page

log

[logical] For productivity, whether to plot log productivity, (default to FALSE) for others, whether to plot on a log scale (default to TRUE).

scales

Are scales shared across all facets (the default, "fixed"), or do they vary across rows ("free_x"), columns ("free_y"), or both rows and columns ("free")?

show_PI

[character] Whether to show the PIs.

show_CI

[character] Whether to show the CIs.

train_test

[logical] (For sspm_fit) Whether to plot a train/test pair plot.

biomass

[character] (For sspm_fit) The biomass variable for predictions.

next_ts

[logical] (For sspm_fit) Whether to plot a predictions for next timestep.

smoothed_biomass

[logical] (For sspm_fit) Whether to plot a the smoothed biomass used for predictions.

aggregate

[logical] (For sspm_fit) For biomass predictions only, whether to aggregate the data to the boundary level. Default to FALSE.

biomass_origin

[character] Biomass variable to plot (from original dataset, optionnal).

Examples

Run this code
if (FALSE) {
# To plot a boundary object and visualize patches/points
plot(sspm_boundary)
# To plot a dataset variable
plot(biomass_smooth, var = "weight_per_km2", log = FALSE)
plot(biomass_smooth, var = "weight_per_km2", use_sf = TRUE)
# To plot a fitted model
# Test-train plot
plot(sspm_model_fit, train_test = TRUE, scales = "free")
# Timeseries plot
plot(sspm_model_fit, log = T, scales = 'free')
plot(sspm_model_fit, log = T, use_sf = TRUE)
plot(sspm_model_fit, biomass = "weight_per_km2_borealis",  scales = "free")
plot(sspm_model_fit, biomass = "weight_per_km2_borealis", use_sf = TRUE)
plot(sspm_model_fit, biomass = "weight_per_km2_borealis",
     next_ts = TRUE, aggregate = TRUE, scales = "free", interval = T)
}

Run the code above in your browser using DataLab