Description Usage Arguments Value Author(s) Examples
Create a colour plot to visualise the results of autowin
or
crosswin
. Displays correlation across all desired climate
windows.
1 |
cor.output |
Output of |
type |
Should be either "A" for data generated by |
arrow |
TRUE or FALSE. Add arrows to plots to pinpoint best window. |
Will generate a colour plot to visualise the correlation data.
Liam D. Bailey and Martijn van de Pol
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 | #Simple test example
#Create data from a subset of our test dataset
#Just use two years
biol_data <- Mass[1:2, ]
clim_data <- MassClimate[grep(pattern = "1979|1986", x = MassClimate$Date), ]
single <- singlewin(xvar = list(Temp = clim_data$Temp),
cdate = clim_data$Date,
bdate = biol_data$Date,
baseline = lm(Mass ~ 1, data = biol_data),
range = c(1, 0),
type = "relative", stat = "mean",
func = c("lin"), cmissing = FALSE, cinterval = "day")
auto <- autowin(reference = single,
xvar = list(Temp = clim_data$Temp),
cdate = clim_data$Date, bdate = biol_data$Date,
baseline = lm(Mass ~ 1, data = biol_data), range = c(1, 0),
stat = "mean", func = "lin",
type = "relative",
cmissing = FALSE, cinterval = "day")
plotcor(auto, type = "A")
## Not run:
# Full working example
# 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),
range = c(72, 15),
stat = "mean", func = "lin",
type = "absolute", refday = c(20, 5),
cmissing = FALSE, cinterval = "day")
# Test the autocorrelation between the climate in this single window and other climate windows.
auto <- autowin(reference = single,
xvar = list(Temp = MassClimate$Temp),
cdate = MassClimate$Date, bdate = Mass$Date,
baseline = lm(Mass ~ 1, data = Mass),
range = c(365, 0),
stat = "mean", func = "lin",
type = "absolute", refday = c(20, 5),
cmissing = FALSE, cinterval = "day")
# Plot the auto-correlation data
plotcor(auto, type = "A")
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.