# NOT RUN {
# Load the dendroTools R package
library(dendroTools)
# Load data
data(data_MVA)
data(data_TRW)
data(data_TRW_1)
data(example_proxies_individual)
data(example_proxies_1)
data(LJ_daily_temperatures)
# 1 Example with fixed width
example_fixed_width <- daily_response(response = data_MVA, env_data = LJ_daily_temperatures,
method = "cor", fixed_width = 0,
row_names_subset = TRUE, remove_insignificant = TRUE,
alpha = 0.05, aggregate_function = 'mean',
reference_window = "end")
example_fixed_width$plot_extreme
# 2 Example for past and present
example_MVA_past <- daily_response(response = data_MVA, env_data = LJ_daily_temperatures,
method = "cor", lower_limit = 21, upper_limit = 180,
row_names_subset = TRUE, previous_year = TRUE,
remove_insignificant = TRUE, alpha = 0.05,
plot_specific_window = 60, subset_years = c(1940, 1980), aggregate_function = 'sum')
example_MVA_present <- daily_response(response = data_MVA, env_data = LJ_daily_temperatures,
method = "cor", lower_limit = 21, upper_limit = 60,
row_names_subset = TRUE, previous_year = TRUE,
remove_insignificant = TRUE, alpha = 0.05,
plot_specific_window = 60, subset_years = c(1981, 2010),
aggregate_function = 'sum')
example_MVA_past$plot_heatmap
example_MVA_present$plot_heatmap
example_MVA_past$plot_specific
example_MVA_present$plot_specific
# 3 Example PCA
example_PCA <- daily_response(response = example_proxies_individual,
env_data = LJ_daily_temperatures, method = "lm",
lower_limit = 21, upper_limit = 180,
row_names_subset = TRUE, remove_insignificant = TRUE,
alpha = 0.01, PCA_transformation = TRUE,
components_selection = "manual", N_components = 2)
summary(example_PCA$PCA_output)
example_PCA$plot_heatmap
# 4 Example negative correlations
example_neg_cor <- daily_response(response = data_TRW_1, env_data = LJ_daily_temperatures,
method = "cor", lower_limit = 21, upper_limit = 180,
row_names_subset = TRUE, remove_insignificant = TRUE,
alpha = 0.05)
example_neg_cor$plot_heatmap
example_neg_cor$plot_extreme
example_neg_cor$temporal_stability
# 5 Example of multiproxy analysis
summary(example_proxies_1)
cor(example_proxies_1)
example_multiproxy <- daily_response(response = example_proxies_1,
env_data = LJ_daily_temperatures,
method = "lm", metric = "adj.r.squared",
lower_limit = 21, upper_limit = 180,
row_names_subset = TRUE, previous_year = FALSE,
remove_insignificant = TRUE, alpha = 0.05)
example_multiproxy$plot_heatmap
# }
Run the code above in your browser using DataLab