Visualise climate cross correlation or autocorrelation.

Share:

Description

Create a colour plot to visualise the results of autowin or crosswin. Displays correlation across all desired climate windows.

Usage

1
plotcor(cor.output, type, arrow = FALSE)

Arguments

cor.output

Output of autowin or crosswin

type

Should be either "A" for data generated by autowin or "C" for data generated by crosswin.

arrow

TRUE or FALSE. Add arrows to plots to pinpoint best window.

Value

Will generate a colour plot to visualise the correlation 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
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
## Not run: 
# 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)

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