# NOT RUN {
HL.NL <- VulnToolkit::HL(level = NL_6min_2013[,2], time = NL_6min_2013[,1])
head(HL.NL)
# }
# NOT RUN {
### Important note: Problems arise when using irregularly-spaced data.
### The best solution is for the user to ensure their data are evenly-spaced.
### An example:
###
### pull data at 6-minute intervals
dat.hr <- noaa(begindate = "20200101", enddate = "20200630", station = "8467150",
interval = "hourly")
### pull data at 1-hr intervals
dat.6min <- noaa(begindate = "20200701", enddate = "20201231", station = "8467150",
interval = "6 minute")
dat.combined <- rbind(dat.hr, dat.6min)
### if time interval is inconsistent the HL output can be unreliable
HL.plot(level = dat.combined[, 2], time = dat.combined[, 1])
### expand 1-hr dataset using the 6-minute time interval
timeSeq <- data.frame(time_GMT = seq.POSIXt(from = min(dat.hr$time_GMT),
to = max(dat.hr$time_GMT),
by = "6 min"))
### create consistently-spaced dataset
dat.hr2 <- plyr::join_all(list(timeSeq, dat.hr))
dat.combined2 <- rbind(dat.hr2, dat.6min)
HL.plot(level = dat.combined2[, 2], time = dat.combined2[, 1])
# }
# NOT RUN {
# }
Run the code above in your browser using DataLab