plot.knnst_spcor: Plot resulting correlation values after KNN space-time...

View source: R/plot.knnst_spcor.R

plot.knnst_spcorR Documentation

Plot resulting correlation values after KNN space-time disaggregation

Description

Implements the plot() method for knnst_spcor and knnst_tmpcor objects relying on ggplot2.

Usage

## S3 method for class 'knnst_spcor'
plot(x, x_names = FALSE, ncol = 1, nrow = NULL, ...)

## S3 method for class 'knnst_tmpcor'
plot(x, ...)

Arguments

x

An object inheriting from class knnst_spcor or knnst_tmpcor.

x_names

Boolean. If TRUE use names for the x axis labels, otherwise use site numbers.

ncol, nrow

Number of columns and rows to use in ggplot2::facet_wrap().

...

Arguments to be passed to subsequent methods.

Details

plon.knnst_spcor() implements the plot() method for knnst_spcor objects relying on ggplot2. See knnst_spatial_cor() to create knnst_spcor objects. Each site a correlation was computed from will be its own facet in the plot.

... is passed to geom_point() and geom_line() to overwrite defaults for size, shape, and color.

plot.knnst_tmpcor() implements the plot() method for knnst_tmpcor objects relying on ggplot2. See knnst_temporal_cor() to create knnst_tmpcor objects.

Examples

sp_cor <- knnst_spatial_cor(ex_disagg, c("Cameo", "Hoover"), 100)
# show as 1 column and 2 rows
plot(sp_cor)

# show as 2 columns and 1 row
plot(sp_cor, ncol = 2)

# include the site names in the x axis labels
plot(sp_cor, x_names = TRUE)

# use a 50-year bin size to compute the stats at Cameo
tmp_cor <- knnst_temporal_cor(ex_disagg, "Cameo", 50)
plot(tmp_cor)


rabutler-usbr/knnstdisagg documentation built on Sept. 14, 2023, 2:47 p.m.