Closed lindsayplatt closed 7 years ago
date: "9999-11-01"
For readNWISuse
:
Aggregate National Data POP,TW,PS,SD,L,I,TP,SI,M,C,A
Aggregate County and State Data
Site Specific Water-Use Data
@ldecicco-USGS we merged #146, did you get a chance to take a look on DEV? I'd like to close this issue if you've done your check on dev and approve.
Maybe make the waterYear
example start on Oct. 1st so it's more obvious in the printout of head
?
co_river_q_fall <- readNWISdv(siteNumber="09403850", parameterCd="00060",
startDate="2014-10-01", endDate="2014-09-30")
I'd also change in the initial table from:
Returns time-series data reported at fixed intervals (15-60 min).
to
Returns time-series data reported from the USGS Instantaneous Values Web Service
They aren't guaranteed to be a fixed interval.
Maybe for parameterCd
and statCd
in the table, you could a links:
https://help.waterdata.usgs.gov/codes-and-parameters/parameters
https://help.waterdata.usgs.gov/code/stat_cd_nm_query?stat_nm_cd=%25&fmt=html
Also, just generally a link here would be a good addition: https://help.waterdata.usgs.gov/
I'm not a huge fan of Table 2...as it is I think it's more confusing than helpful. My first vote would be to take it out. The second vote would somehow indicate what functions the arguments are used in. Now I finally understand why you kept asking about type character can be "base", "corr", or "exsa"
...by itself, that makes no sense. At least if you know that argument is specific to the rating function, you can read more in the rating's help file to make more sense of it. Same with statReportType
...this table might make you think that would be an acceptable argument in the readNWISdv
function (since readNWISdv
aggregates by a stat type).
I also think the sentence: "Note that the web service name might differ from the dataRetrieval argument name, e.g. site is NWIS web service name but siteNumber is used in readNWIS functions." is not necessary. What we were trying to do with dataRetrieval is set a consistent user experience. They can use siteNumber
all over (NWIS, WQP, NGWMN). If they're savvy enough to be checking the web service documentation and use site
....that will work too. But by pointing that out here...I think that will just confuse people.
Also, seems to be some formatting problem : < name=“readnwisdata-county”
That's all I've got! Overall looks good!
startDate
to "2014-09-28" so you can see the change from 2014 to 2015 when you run head
.Fixing the table issue, then a PR will be coming.
Argument <- unique(allArguments)
Description <- Description[!duplicated(allArguments)]
df <- data.frame(Argument, Description, stringsAsFactors = FALSE) df$Description[df$Argument == "parameterCd"] <- paste(df$Description[df$Argument == "parameterCd"], 'see: <a href"https://help.waterdata.usgs.gov/codes-and-parameters/parameters">NWIS help')
library(htmlTable) htmlTable(df, caption="Table 2. readNWIS argument definitions", rnames=FALSE, align=c("l","l"), col.rgroup = c("none", "#F7F7F7"), css.cell="padding-bottom: 0.5em; padding-right: 0.5em; padding-top: 0.5em;")
3. b. I really appreciate that it's neat to auto-generate Table 2....but my concerns still stand. As a stand-alone table, it's confusing, and possibly mis-leading that people will think all arguments are available in all functions. I don't understand why it wouldn't be more helpful to emphasize that people go to the help pages because there's a wealth of information there.
3. c. If there's a compelling reason to keep Table 2....then split it up?:
You could modify the first table here:
https://github.com/USGS-R/dataRetrieval/wiki
Or, add a column with the appropriate functions:
Function <- c("readNWISdata", "readNWISdv", "readNWISgwl", "readNWISmeas", "readNWISpCode", "readNWISpeak", "readNWISqw", "readNWISrating", "readNWISsite", "readNWISstat", "readNWISuse", "readNWISuv") allArguments_list <- lapply(Function, function(f) { names(formals(f)) }) names(allArguments_list) <- Function
allArguments <- unlist(lapply(Function, function(f) { names(formals(f)) })) Description <- unlist(lapply(Function, function(fn){ unlist(lapply(names(formals(fn)), extract_arg_def, pkg="dataRetrieval", fn=fn)) }))
Argument <- unique(allArguments) Description <- Description[!duplicated(allArguments)] Functions <- c() for(i in Argument){ Functions <- c(Functions, paste(names(allArguments_list)[which(sapply(allArguments_list, function(x) i %in% x))], collapse = "\n")) }
df <- data.frame(Argument, Description, Functions, stringsAsFactors = FALSE)
library(htmlTable) htmlTable(df, caption="Table 2. readNWIS argument definitions", rnames=FALSE, align=c("l","l"), col.rgroup = c("none", "#F7F7F7"), css.cell="padding-bottom: 0.5em; padding-right: 0.5em; padding-top: 0.5em;")
@ldecicco-USGS my solution for your concern w/ Table 2 was to split it up. See #164.
I like the code to get links into the table! I'm going to add that.
I think this is good thanks to @ldecicco-usgs work in #167.
Parent: dataRetrieval: accessing timeseries data