# Visualise climate autocorrelation
data(Mass)
data(MassClimate)
# Fit a single climate window using the datasets Mass and MassClimate.
single <- singlewin(xvar = list(Temp = MassClimate$Temp),
cdate = MassClimate$Date, bdate = Mass$Date,
baseline = lm(Mass ~ 1, data = Mass),
furthest = 72, closest = 15,
stat = "mean", func = "lin",
type = "fixed", cutoff.day = 20, cutoff.month = 5,
cmissing = FALSE, cinterval = "day")
# Test the autocorrelation between the climate in this single window and other climate windows.
auto <- autowin(reference = single$BestModelData$climate,
xvar = list(Temp = MassClimate$Temp),
cdate = MassClimate$Date, bdate = Mass$Date,
baseline = lm(Mass ~ 1, data = Mass),
furthest = 365, closest = 0,
stat = "mean", func = "lin",
type = "fixed", cutoff.day = 20, cutoff.month = 5,
cmissing = FALSE, cinterval = "day")
# Plot the auto-correlation data
plotcor(auto, type = "A")Run the code above in your browser using DataLab