Learn R Programming

growthTrendR (version 0.2.1)

plot_scale: plot median of ring width of the target site and its neighbours

Description

This function plots the time series and the geographical distribution of the median ring-width measurements to contrast the target site with its neighbouring sites.

Usage

plot_scale(dt.scale)

Value

A named list with two ggplot objects showing the contrast between the target site and its neighboring sites:

plot.year

A time-series plot of median ring width by year.

plot.ll

A spatial plot showing the geographic location of the sites, with point size proportional to the magnitude of site-level ring-width measurements.

Arguments

dt.scale

a table with class "cfs_scale", resulting from function CFS_scale()

Examples

Run this code
# loading formatted
dt.samples_trt <- readRDS(system.file("extdata", "dt.samples_trt.rds", package = "growthTrendR"))
all.sites <- dt.samples_trt$tr_all_wide[,.N, by = c("species", "uid_site", "site_id")][, N:=NULL]
# e.g. taking the target sites
target_site <- all.sites[c(1,2), -"uid_site"]
ref.sites <- merge(
dt.samples_trt$tr_all_wide[,c("species", "uid_site", "site_id",
 "latitude","longitude", "uid_radius")],
dt.samples_trt$tr_all_long$tr_7_ring_widths, by = c("uid_radius"))
dt.scale <- CFS_scale( target_site = target_site, ref_sites = ref.sites,
scale.label_data_ref = "demo-samples", scale.max_dist_km = 200, scale.N_nbs = 2)
plots.lst <- plot_scale(dt.scale[[1]])

Run the code above in your browser using DataLab