Learn R Programming

climwin (version 0.1.2)

plotcor: Visualise climate cross correlation or autocorrelation.

Description

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

Usage

plotcor(cor.output, type = type)

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.

Value

  • Will generate a colour plot to visualise the correlation data.

Examples

Run this code
# 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