Visualise the best climate window

Share:

Description

Create a scatterplot showing the fit of the best climate window model through the biological data.

Usage

1
plotbest(dataset, bestmodel, bestmodeldata)

Arguments

dataset

A dataframe containing information on all fitted climate windows. Output from slidingwin.

bestmodel

A model object. The strongest climate window model. Output from singlewin or slidingwin.

bestmodeldata

A dataframe with the data used to fit the strongest climate window model. Output from singlewin or slidingwin.

Value

Returns a scatterplot with a fitted line to show the fit of the best model through the data.

Author(s)

Liam D. Bailey and Martijn van de Pol

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
# Visualise the best climate window from the datasets Mass and MassClimate

data(MassOutput)
data(Mass)
data(MassClimate)

single <- singlewin(xvar = list(Temp = MassClimate$Temp), 
                   cdate = MassClimate$Date, bdate = Mass$Date, 
                   baseline = lm(Mass ~ 1, data = Mass),
                   range = c(72, 15), 
                   stat = "mean", func = "lin", 
                   type = "absolute", refday = c(20, 5), 
                   cmissing = FALSE, cinterval = "day")
           
plotbest(dataset = MassOutput, bestmodel = single$BestModel,
        bestmodeldata = single$BestModelData)
             

Want to suggest features or report bugs for rdrr.io? Use the GitHub issue tracker.