NOAA-OCM / SWMPrExtension

Functions for Analyzing and Plotting SWMP Estuary Monitoring Data from the NERR System archive at
http://cdmo.baruch.sc.edu/
Other
12 stars 5 forks source link

Annual_range not working #23

Closed DaveEslinger closed 6 years ago

DaveEslinger commented 6 years ago

I get the following error message when trying ot use annual_range on a SWMPr data object:

annual_range(wqClean, param = 'temp', target_yr = 2007) Error: by can't contain join column .data$season which is missing from RHS

Complete R file is here:

if(!require(SWMPr)) {
  install.packages("SWMPr"); 
  require(SWMPr) } #load / install+load dlply
if(!require(SWMPrExtension)) {
  install.packages("SWMPrExtension"); 
  require(SWMPrExtension) } #load / install+load dlply

wd <- "~/R/SWMP/Data"
setwd(wd)
station <- 'gtmpc'

#years <- '2007'
years <- ''
datType <- 'wq'
datFile <- paste(station,datType,years,sep="")
wqAll <- import_local(wd, datFile, trace = T)
wqClean<-qaqc(wqAll,qaqc_keep = c(0,3,5))
wqHist<- qaqc(wqAll,qaqc_keep = 4)

plot(temp ~ datetimestamp, data = wqClean,
     type = "l",
     lwd= 1,
     lty=1,
     col = "black",
     main = paste("Temperature for", datFile, sep=" "),
     xlab = "Date",
     #     xlim=c("2005-08-11 10:30:00 CST","2016-10-19 09:00:00 CST" ),
     ylab = expression(paste("Temperature (",degree,"C)")),
     ylim = c(0, 40))
#lines(temp ~  datetimestamp, data = wqHist,type='l',col='cornflowerblue')
lines(temp ~  datetimestamp, data = wqHist,type='l',col='red')

# All of this was basic intro stuff from Marcus' SWMPr training.  It works.

# Now we have some data so we can test SWMPrExtension functions
seas <- assign_season(wqClean$datetimestamp)
levels(seas)

annual_range(wqClean, param = 'temp', target_yr = 2007)
padilla410 commented 6 years ago

Should be resolved with pull request #24

padilla410 commented 6 years ago

I've started updating the version number for the package (debugging and updating as I go). I just merged a pull request for 0.1.6. I think you will need to repeat the process of devtools::install_github('padilla410/SWMPrExtension') to see the update