refprox: Plot reference proximity values for a test site

Description Usage Arguments Details Value Examples

View source: R/refprox.R

Description

Plot reference proximity values for a test site

Usage

1
2
3
4
refprox(
  station_dat,
  output = c("map", "mapmod", "jit", "jitmod", "pca", "pcamod", "dat")
)

Arguments

station_dat

input data.frame for the test site that includes all station data

output

chr string indicating desired output from the function

Details

station_dat must have the same GIS predictors as those in bugs_stations[[2]], specifically "StationCode", "AREA_SQKM", "New_Lat", "New_Long", "SITE_ELEV", "PPT_00_09", "TEMP_00_09", "SumAve_P", "KFCT_AVE", "BDH_AVE", "P_MEAN", "ELEV_RANGE". The StationCode must also not be a reference site, as in those in loadRefData().

Value

A plot of average proximity values across all metrics if output = "map", a facetted map for each model and predictor of proximity values if output = "mapmod", a jitter plot of the distribution of proximity values by predictor if output = "jit", a faceted jitter plot of the disributin of proximity valuues by predictor and model if output = "jitmod", a PCA plot of principal components one and two for all metric proximity values if output = "pca", a faceted PCA plot of principal components one and two for all metric proximity values by model if output = "pcamod", or a data.frame of the proximity values for all reference sites and the test site if output = "dat".

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
station_dat <- bugs_stations[[2]][1, ]

# map, default
refprox(station_dat)

# map by model
refprox(station_dat, output = 'mapmod')

# jitter
refprox(station_dat, output = 'jit')

# jitter by model
refprox(station_dat, output = 'jitmod')

# pca
refprox(station_dat, output = 'pca')

# pca by model
refprox(station_dat, output = 'pcamod')

# data
refdat <- refprox(station_dat, output = 'dat')
head(refdat)
tail(refdat)

SCCWRP/CSCI documentation built on Feb. 8, 2022, 11:25 a.m.