diff --git a/R/importWaterML1.r b/R/importWaterML1.r index 6e42cdb8c1d350bd4effb1672a2aa0387b01b29c..5b3a84deb7f66b863f9131c3897b9e8276c6b416 100644 --- a/R/importWaterML1.r +++ b/R/importWaterML1.r @@ -240,7 +240,7 @@ importWaterML1 <- function(obs_url,asDateTime=FALSE, tz=""){ # YYYY-MM-DDTHH:MM:SS.000-XX:00 numChar=29 if(abs(max(numChar) - min(numChar)) != 0){ - message("Mixed date types, not converted to POSIXct") + warning("Mixed date types, not converted to POSIXct") } else { numChar <- numChar[1] if(numChar == 4){ diff --git a/R/whatNWISData.r b/R/whatNWISData.r index fb387313de58f236eb86d6ee731a8dd355aec107..d182501aaaccd811b0600b91f6ff717c9f9a588b 100644 --- a/R/whatNWISData.r +++ b/R/whatNWISData.r @@ -75,15 +75,15 @@ whatNWISdata <- function(siteNumbers,service="all",parameterCd="all",statCd="all if(!("all" %in% parameterCd)){ parameterCdCheck <- all(nchar(parameterCd) == 5) & all(!is.na(suppressWarnings(as.numeric(parameterCd)))) - if(!parameterCdCheck){ - goodIndex <- which(parameterCd %in% parameterCdFile$parameter_cd) - if(length(goodIndex) > 0){ - badparameterCd <- parameterCd[-goodIndex] - } else { - badparameterCd <- parameterCd + if(parameterCdCheck){ + + pCodeInfo <- readNWISpCode(parameterCd) + + if(nrow(pCodeInfo) != length(parameterCd)){ + badPcodes <- parameterCd[!(parameterCd %in% pCodeInfo$parameter_cd)] + warning("The following parameterCds seem mistyped:",paste(badPcodes,collapse=","), "and will be ignored.") + parameterCd <- unique(pCodeInfo$parameter_cd) } - message("The following parameterCds seem mistyped:",paste(badparameterCd,collapse=","), "and will be ignored.") - parameterCd <- parameterCd[goodIndex] } } diff --git a/man/importWQP.Rd b/man/importWQP.Rd index e0e9e915c10a1eccb2e802bce571802e45cbe246..d2cb8dddd9caf6b18a48e76a08023ca40f0a3c2c 100644 --- a/man/importWQP.Rd +++ b/man/importWQP.Rd @@ -27,10 +27,11 @@ Imports data from the Water Quality Portal based on a specified url. ## Examples take longer than 5 seconds: rawSampleURL <- constructWQPURL('USGS-01594440','01075', '', '') +\dontrun{ rawSample <- importWQP(rawSampleURL) url2 <- paste0(rawSampleURL,"&zip=yes") rawSample2 <- importWQP(url2, TRUE) -\dontrun{ + STORETex <- constructWQPURL('WIDNR_WQX-10032762','Specific conductance', '', '') STORETdata <- importWQP(STORETex) } diff --git a/man/readNWISuv.Rd b/man/readNWISuv.Rd index b8fbdcfd9a52d66298d458f9b1d3e80f44668a77..fd20bfcb14141a81eb978c9a1f1386094b7e4b11 100644 --- a/man/readNWISuv.Rd +++ b/man/readNWISuv.Rd @@ -65,7 +65,6 @@ rawData <- readNWISuv(siteNumber,parameterCd,startDate,endDate) timeZoneChange <- readNWISuv(c('04024430','04024000'),parameterCd, "2013-11-03","2013-11-03") -firstSite <- timeZoneChange[timeZoneChange$site_no == '04024430',] } \seealso{ \code{\link{renameNWISColumns}}, \code{\link{importWaterML1}} diff --git a/vignettes/figure/getNWIStemperaturePlot-1.pdf b/vignettes/figure/getNWIStemperaturePlot-1.pdf index 579e593554b281fe8a4012fa060bc46b8f112444..58ac3df00567a9e1bf2b600e82f38c8ca0033db0 100644 Binary files a/vignettes/figure/getNWIStemperaturePlot-1.pdf and b/vignettes/figure/getNWIStemperaturePlot-1.pdf differ