## Not run: ------------------------------------
# # Read in the Cook and Krusic (2004; The North American Drought Atlas) reconstruction
# # of Palmer Drought Severity Index (PDSI) for the Jemez Mountains area (gridpoint 133).
# target_url <- paste0('http://iridl.ldeo.columbia.edu',
# '/SOURCES/.LDEO/.TRL/.NADA2004'
# '/pdsiatlashtml/pdsiwebdata/1050w_350n_133.txt')
# pdsi <- read.table(target_url, header = TRUE, row.names = 1)
# pdsi <- subset(pdsi, select = "RECON")
#
# # Run SEA on Peggy Mesa (pgm) data
# data(pgm)
# (pgm.comp <- composite(pgm))
#
# (pgm.sea <- run_sea(pdsi, pgm.comp))
#
# # Make a bargraph with confidence intervals
# par(mar=c(2, 3, 1, 1), oma=c(3, 3, 1, 1))
# bp <- barplot(pgm.sea[[3]]$mean_value,
# col=c(rep("grey75", 3),"grey45", "grey30",
# "grey75", "grey30", rep("grey75", 4)),
# ylab = '', las=1, cex.axis=1.3, cex=1.3, ylim=c(-2, 2))
# axis(1, at=bp, labels = -6:4, tick=FALSE, cex.axis=1.3)
# lines(bp, pgm.sea[[3]]$lower_95_perc, lwd=2, lty=2)
# lines(bp, pgm.sea[[3]]$upper_95_perc, lwd=2, lty=2)
# lines(bp, pgm.sea[[3]]$lower_99_perc, lwd=2, lty=3)
# lines(bp, pgm.sea[[3]]$upper_99_perc, lwd=2, lty=3)
# mtext(expression(bold('PDSI departure')), side=2, line=2.2, cex=1.5)
# mtext(expression(bold('Lag year')), side=1, line=3.3, cex=1.5)
## ---------------------------------------------
## Not run: ------------------------------------
# # For users who want to perform SEA very near to EVENT.exe and/or have reproducable draws from
# # the bootstrap procedure, consider including the \code{set.seed} function prior to \code{run_sea}.
# # Convention is to provide a long integer, such as a birthday (e.g. 3191982).
# # In the EVENT.exe program, Richard Holmes used the number of days since 1 January 1935.
# days <- as.numeric(Sys.Date() - as.Date("1jan1935", "%d%b%Y"))
# set.seed(days)
## ---------------------------------------------
Run the code above in your browser using DataLab