plot_per_id: Plot data and fitted model per each study id

Description Usage Arguments Details Value Examples

Description

plot_per_id Plots raw data and a fitted model for a single study id in the dataset. This model is fitted with fit_cond_id. Plot also visualizes the p value for the fit of the model.

Usage

1
2
plot_per_id(data, temperature = FALSE, precipitation = FALSE,
  phenology = FALSE, morphology = FALSE, id, condition)

Arguments

data

A dataframe containing per each study the time series of relevant variables (i.e. yearly climate values, yearly trait values or yearly selection differentials) to be analyzed.

temperature

A boolean indicating if the temperature data should be extracted (default is FALSE).

precipitation

A boolean indicating if the precipitation data should be extracted (default is FALSE).

phenology

A boolean indicating if the phenological data should be extracted (default is FALSE).

morphology

A boolean indicating if the morphological data should be extracted (default is FALSE).

id

A character specifying the unique study id.

condition

A character specifying which condition is to be tested (for more details see Radchuk et al. (in review)):

  • '1' - Condition 1 (effect of year on climate);

  • '2' - Condition 2 (effect of climate on traits);

  • '3' - Condition 3 (testing whether weighted mean selection over years differs from 0);

  • '2b' - Condition 2, but also with abundance included as a predictor;

  • '3b' - testing whether selection changes over years.

Details

This function fits a single model per study id. This model includes predictors of interest and accounts for temporal autocorrelation. Predictors of interest can be:

Value

A plot showing the raw data points and a fitted line.

Examples

1
2
3
4
5
6
7
plot_per_id(data = dat_Clim, temperature = TRUE,
            precipitation = FALSE, phenology = TRUE,
            morphology = TRUE, id = '1', condition = '1')

plot_per_id(data = dat_Trait, temperature = TRUE,
            precipitation = FALSE, phenology = TRUE,
            morphology = FALSE, id = '1', condition = '2')

radchukv/adRes documentation built on June 1, 2019, 7:05 p.m.