# Test for auto-correlation using 'Mass' and 'MassClimate' data frames
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")
# View the output
head(auto)
# Plot the output
plotcor(auto, type = "A")Run the code above in your browser using DataLab