diff --git a/inst/doc/Rplots.pdf b/inst/doc/Rplots.pdf index 1a606c0ef3c2e17006b279873685a4919028c00d..621263b66ef1eb5e74710e9ed85e6bd425ff6ced 100644 Binary files a/inst/doc/Rplots.pdf and b/inst/doc/Rplots.pdf differ diff --git a/inst/doc/dataRetrieval-concordance.tex b/inst/doc/dataRetrieval-concordance.tex index 22c2abd3ebad9cffd91010c8bcd6077b8b07f6c3..959494902083fe9e0cfc62826276dec1c0892f5d 100644 --- a/inst/doc/dataRetrieval-concordance.tex +++ b/inst/doc/dataRetrieval-concordance.tex @@ -5,8 +5,8 @@ 1 3 4 0 1 2 4 1 1 6 4 0 1 1 1 4 3 0 2 1 3 0 1 2 3 1 1 -5 1 9 11 1 1 2 1 % 0 2 1 1 2 1 0 1 4 6 0 2 2 10 0 1 2 3 1 1 5 7 0 1 2 3 1 1 -5 1 9 10 1 1 % 2 1 0 1 2 1 0 2 1 1 3 4 0 1 2 3 1 1 5 37 0 1 2 3 1 1 3 2 0 1 1 7 0 1 2 % -3 1 1 6 8 0 1 2 2 1 1 -4 1 8 14 1 1 2 1 0 3 1 1 2 1 1 29 0 1 2 4 1 1 2 % -1 0 1 1 28 0 1 2 2 1 1 2 4 0 1 2 1 5 27 0 1 2 3 1 1 2 12 0 1 1 19 0 1 2 % -31 1 1 2 1 0 3 1 12 0 1 2 15 1 1 2 1 0 3 1 19 0 1 2 19 1 1 3 5 0 1 2 2 % -1 1 4 6 0 1 2 2 1 1 4 6 0 1 2 3 1 1 2 4 0 1 2 6 1 1 2 1 0 1 1 3 0 1 2 1 % -1 1 2 4 0 1 2 22 1} +3 1 1 6 8 0 1 2 2 1 1 -4 1 8 8 1 1 3 2 0 1 1 12 0 1 2 10 1 1 2 1 0 3 1 % +1 2 1 1 29 0 1 2 1 10 18 0 1 2 4 1 1 3 2 0 1 1 28 0 1 2 1 10 20 0 1 2 3 % +1 1 2 4 0 1 2 1 5 27 0 1 2 31 1 1 2 1 0 3 1 12 0 1 2 15 1 1 2 1 0 3 1 % +19 0 1 2 19 1 1 3 5 0 1 2 2 1 1 4 6 0 1 2 2 1 1 4 6 0 1 2 3 1 1 2 4 0 1 % +2 6 1 1 2 1 0 1 1 3 0 1 2 1 1 1 2 4 0 1 2 22 1} diff --git a/inst/doc/dataRetrieval-fig1.pdf b/inst/doc/dataRetrieval-fig1.pdf index d8ac3a25ca4cec18222de317c3c132e3887d9c36..7b14512009128caed1019b26888126d6d2b0e5ea 100644 Binary files a/inst/doc/dataRetrieval-fig1.pdf and b/inst/doc/dataRetrieval-fig1.pdf differ diff --git a/inst/doc/dataRetrieval-fig2.pdf b/inst/doc/dataRetrieval-fig2.pdf index 1cc7578f4595035886605d41c678db826e5169c1..fddc2e53cece25256ebbb56c7346f742bf31e574 100644 Binary files a/inst/doc/dataRetrieval-fig2.pdf and b/inst/doc/dataRetrieval-fig2.pdf differ diff --git a/inst/doc/dataRetrieval-fig3.pdf b/inst/doc/dataRetrieval-fig3.pdf index b0fb05dbbd9754f67c5ba8fae409bb582bcbe288..f15e2b1f4423c1290cbc82297adc8dbd601cdeea 100644 Binary files a/inst/doc/dataRetrieval-fig3.pdf and b/inst/doc/dataRetrieval-fig3.pdf differ diff --git a/inst/doc/dataRetrieval.Rnw b/inst/doc/dataRetrieval.Rnw index 1d1fe76758a46831be981862d1820bff6d555b59..42f710ae98aef7f1d069a90d79f0a3d631ef2a3f 100644 --- a/inst/doc/dataRetrieval.Rnw +++ b/inst/doc/dataRetrieval.Rnw @@ -328,6 +328,16 @@ with(dissolvedNitrateSimple, plot( \caption{Nitrate plot of Choptank River.} \end{figure} +%------------------------------------------------------------ +\subsection{Water Quality Retrievals} +%------------------------------------------------------------ +Additionally, there are additional data sets available on the Water Quality Portal (\url{http://www.waterqualitydata.us/}). These data sets can be housed in either the STORET or NWIS database. Since STORET does not use USGS parameter codes, a 'characteristic name' must be supplied. The following example retrieves specific conductance from a DNR site in Wisconsin. + +<<label=getQWData, echo=TRUE>>= +specificCond <- getWQPData('WIDNR_WQX-10032762', + 'Specific conductance', '', '') +head(specificCond) +@ %------------------------------------------------------------ @@ -349,15 +359,41 @@ Daily <- getDVData(siteNumber, "00060", startDate, endDate,interactive=FALSE) summary(Daily) @ -Date is a column with dates stored in an R Date type. Julian is an integer number of days since January 1, 1850. Month and Day are integers from the start of each year. DecYear is the decimal year. MonthSeq is the (integer) number of months since 1850. Qualifier is the code from NWIS as mentioned in the raw data section. i is a count of observations. LogQ is the natural logarithm of Q. The code will shift the discharge values to 0.001 times the mean if there are zero values detected in order to perform the logarithm. Columns Q7 and Q30 are 7 and 30 day running averages. +<<label=colNamesDaily, echo=FALSE,results=tex>>= +ColumnName <- c("Date", "Q", "Julian","Month","Day","DecYear","MonthSeq","Qualifier","i","LogQ","Q7","Q30") +Type <- c("Date", "number", "number","integer","integer","number","integer","string","integer","number","number","number") +Description <- c("Date", "Discharge in cms", "Number of days since January 1, 1850", "Month of the year [1-12]", "Day of the year [1-366]", "Decimal year", "Number of months since January 1, 1850", "Qualifing code", "Index", "Natural logarithm of Q", "7 day running average of Q", "30 running average of Q") + +DF <- data.frame(ColumnName,Type,Description) + +data.table <- xtable(DF, + caption="Daily dataframe") +print(data.table, caption.placement="top",floating="FALSE",latex.environments=NULL) +@ +\\* +The code will shift the discharge values to 0.001 times the mean if there are zero values detected in order to perform the logarithm. Columns Q7 and Q30 are 7 and 30 day running averages. The function to obtain sample data from the water quality portal is getSampleData. The arguments for this function are also siteNumber, ParameterCd, StartDate, EndDate, interactive. These are the same inputs as getRawQWData or getQWData as described in the previous section. <<secondExample>>= -Sample <-getSampleData(siteNumber,parameterCd,startDate, endDate,interactive=FALSE) +Sample <-getSampleData(siteNumber,parameterCd, + startDate, endDate,interactive=FALSE) summary(Sample) @ +<<label=colNamesQW, echo=FALSE,results=tex>>= +ColumnName <- c("Date", "ConcLow", "ConcHigh", "Uncen", "ConcAve", "Julian","Month","Day","DecYear","MonthSeq","SinDY","CosDY","Q","LogQ") +Type <- c("Date", "number","number","integer","number", "number","integer","integer","number","integer","number","number","number","number") +Description <- c("Date", "Lower limit of concentration", "Upper limit of concentration", "Uncensored data (1=true, 0=false)", "Average concentration","Number of days since January 1, 1850", "Month of the year [1-12]", "Day of the year [1-366]", "Decimal year", "Number of months since January 1, 1850", "Sine of ...", "Cosine of ...", "Discharge in cms", "Natural logarithm of flow") + +DF <- data.frame(ColumnName,Type,Description) + +data.table <- xtable(DF, + caption="Sample dataframe") +print(data.table, caption.placement="top",floating="FALSE",latex.environments=NULL) +@ + + The function to obtain "metadata", data about the gage station and measured parameters is getMetaData. This function essentially combines getSiteFileData and getParameterInfo, producing one dataframe called INFO. <<ThirdExample>>= @@ -374,14 +410,6 @@ print(data.table, caption.placement="top",floating="FALSE",latex.environments=NU \\* -<<forthExample>>= -Sample <- mergeReport() -head(Sample) -@ - -The difference between these dataframes, and the dataframes in the previous sections is that ... - - \newpage %------------------------------------------------------------ \section{Retrieving User-Generated Data Files} diff --git a/inst/doc/dataRetrieval.log b/inst/doc/dataRetrieval.log index 6c48d6af5b0100eb7c44df1f88b0ce65bc55daaa..0d1e8a63bb9cb347182d3b494eac6fd87d92c531 100644 --- a/inst/doc/dataRetrieval.log +++ b/inst/doc/dataRetrieval.log @@ -1,4 +1,4 @@ -This is pdfTeX, Version 3.1415926-2.3-1.40.12 (MiKTeX 2.9) (preloaded format=pdflatex 2012.1.6) 30 JAN 2013 16:51 +This is pdfTeX, Version 3.1415926-2.3-1.40.12 (MiKTeX 2.9) (preloaded format=pdflatex 2012.1.6) 5 FEB 2013 15:37 entering extended mode **dataRetrieval.tex (D:\LADData\RCode\dataRetrieval\inst\doc\dataRetrieval.tex @@ -441,17 +441,18 @@ LaTeX Info: Redefining \nameref on input line 42. ) (D:\LADData\RCode\dataRetrieval\inst\doc\dataRetrieval-concordance.tex) (D:\LADData\RCode\dataRetrieval\inst\doc\dataRetrieval.toc) \tf@toc=\write5 -LaTeX Font Info: Try loading font information for T1+aett on input line 60. -("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\ae\t1aett.fd" -File: t1aett.fd 1997/11/16 Font definitions for T1/aett. -) Overfull \vbox (21.68121pt too high) has occurred while \output is active [] [1 {C:/Users/ldecicco/AppData/Local/MiKTeX/2.9/pdftex/config/pdftex.map}] +LaTeX Font Info: Try loading font information for T1+aett on input line 60. + +("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\ae\t1aett.fd" +File: t1aett.fd 1997/11/16 Font definitions for T1/aett. +) Overfull \vbox (21.68121pt too high) has occurred while \output is active [] @@ -476,7 +477,7 @@ Overfull \vbox (21.68121pt too high) has occurred while \output is active [] Overfull \vbox (21.68121pt too high) has occurred while \output is active [] -[6] <dataRetrieval-fig1.pdf, id=132, 433.62pt x 289.08pt> +[6] <dataRetrieval-fig1.pdf, id=137, 433.62pt x 289.08pt> File: dataRetrieval-fig1.pdf Graphic file (type pdf) <use dataRetrieval-fig1.pdf> @@ -490,7 +491,7 @@ Overfull \vbox (21.68121pt too high) has occurred while \output is active [] Overfull \vbox (21.68121pt too high) has occurred while \output is active [] -[8] <dataRetrieval-fig2.pdf, id=150, 433.62pt x 289.08pt> +[8] <dataRetrieval-fig2.pdf, id=155, 433.62pt x 289.08pt> File: dataRetrieval-fig2.pdf Graphic file (type pdf) <use dataRetrieval-fig2.pdf> @@ -509,45 +510,48 @@ Overfull \vbox (21.68121pt too high) has occurred while \output is active [] Overfull \vbox (21.68121pt too high) has occurred while \output is active [] -[10] <dataRetrieval-fig3.pdf, id=167, 433.62pt x 289.08pt> +[10] <dataRetrieval-fig3.pdf, id=172, 433.62pt x 289.08pt> File: dataRetrieval-fig3.pdf Graphic file (type pdf) <use dataRetrieval-fig3.pdf> Package pdftex.def Info: dataRetrieval-fig3.pdf used on input line 416. (pdftex.def) Requested size: 358.46039pt x 238.98355pt. - -Overfull \vbox (21.68121pt too high) has occurred while \output is active [] - - -[11 <D:/LADData/RCode/dataRetrieval/inst/doc/dataRetrieval-fig3.pdf>] -LaTeX Font Info: Try loading font information for TS1+aett on input line 465 +LaTeX Font Info: Try loading font information for TS1+aett on input line 428 . (C:/PROGRA~1/R/R-215~1.2/share/texmf/tex/latex\ts1aett.fd File: ts1aett.fd ) -LaTeX Font Info: Try loading font information for TS1+cmtt on input line 465 +LaTeX Font Info: Try loading font information for TS1+cmtt on input line 428 . ("C:\Program Files (x86)\MiKTeX 2.9\tex\latex\base\ts1cmtt.fd" File: ts1cmtt.fd 1999/05/25 v2.5h Standard LaTeX font definitions ) -LaTeX Font Info: Font shape `TS1/aett/m/n' in size <10.95> not available -(Font) Font shape `TS1/cmtt/m/n' tried instead on input line 465. +LaTeX Font Info: Font shape `TS1/aett/m/sl' in size <10.95> not available +(Font) Font shape `TS1/cmtt/m/sl' tried instead on input line 428. + Overfull \vbox (21.68121pt too high) has occurred while \output is active [] -[12] -Underfull \hbox (badness 10000) in paragraph at lines 515--543 +[11 <D:/LADData/RCode/dataRetrieval/inst/doc/dataRetrieval-fig3.pdf>] +Overfull \vbox (21.68121pt too high) has occurred while \output is active [] - [] +[12] +LaTeX Font Info: Font shape `TS1/aett/m/n' in size <10.95> not available +(Font) Font shape `TS1/cmtt/m/n' tried instead on input line 486. Overfull \vbox (21.68121pt too high) has occurred while \output is active [] [13] +Underfull \hbox (badness 10000) in paragraph at lines 580--608 + + [] + + Overfull \vbox (21.68121pt too high) has occurred while \output is active [] @@ -568,7 +572,7 @@ Overfull \vbox (21.68121pt too high) has occurred while \output is active [] [18] -Overfull \hbox (63.21521pt too wide) in paragraph at lines 714--715 +Overfull \hbox (63.21521pt too wide) in paragraph at lines 742--743 \T1/aer/m/n/10.95 library/2.15/dataRetrieval, and the de-fault for a Mac: /User s/userA/Library/R/2.15/library/dataRetrieval. [] @@ -582,42 +586,44 @@ Overfull \vbox (21.68121pt too high) has occurred while \output is active [] [20] -Package atveryend Info: Empty hook `BeforeClearDocument' on input line 762. +Package atveryend Info: Empty hook `BeforeClearDocument' on input line 790. Overfull \vbox (21.68121pt too high) has occurred while \output is active [] [21] -Package atveryend Info: Empty hook `AfterLastShipout' on input line 762. +Package atveryend Info: Empty hook `AfterLastShipout' on input line 790. (D:\LADData\RCode\dataRetrieval\inst\doc\dataRetrieval.aux) -Package atveryend Info: Executing hook `AtVeryEndDocument' on input line 762. -Package atveryend Info: Executing hook `AtEndAfterFileList' on input line 762. +Package atveryend Info: Executing hook `AtVeryEndDocument' on input line 790. +Package atveryend Info: Executing hook `AtEndAfterFileList' on input line 790. Package rerunfilecheck Info: File `dataRetrieval.out' has not changed. -(rerunfilecheck) Checksum: 947AB1EDE7FA00AD992436EE51DED5F2;1235. +(rerunfilecheck) Checksum: EC7004D55096E88EE19A0D81007FF8E5;1310. ) Here is how much of TeX's memory you used: - 7385 strings out of 494045 - 105864 string characters out of 3145961 - 188876 words of memory out of 3000000 - 10490 multiletter control sequences out of 15000+200000 - 40004 words of font info for 82 fonts, out of 3000000 for 9000 + 7390 strings out of 494045 + 105940 string characters out of 3145961 + 191876 words of memory out of 3000000 + 10493 multiletter control sequences out of 15000+200000 + 40303 words of font info for 83 fonts, out of 3000000 for 9000 715 hyphenation exceptions out of 8191 - 35i,8n,28p,866b,481s stack positions out of 5000i,500n,10000p,200000b,50000s + 35i,8n,28p,866b,483s stack positions out of 5000i,500n,10000p,200000b,50000s <C:\Users\ldecicco\AppData\Local\MiKTeX\2.9\fonts\pk\ljfour\jknappen\ec\dpi6 -00\tctt1095.pk><C:/Program Files (x86)/MiKTeX 2.9/fonts/type1/public/amsfonts/c -m/cmbx10.pfb><C:/Program Files (x86)/MiKTeX 2.9/fonts/type1/public/amsfonts/cm/ -cmbx12.pfb><C:/Program Files (x86)/MiKTeX 2.9/fonts/type1/public/amsfonts/cm/cm -mi10.pfb><C:/Program Files (x86)/MiKTeX 2.9/fonts/type1/public/amsfonts/cm/cmr1 -0.pfb><C:/Program Files (x86)/MiKTeX 2.9/fonts/type1/public/amsfonts/cm/cmr12.p -fb><C:/Program Files (x86)/MiKTeX 2.9/fonts/type1/public/amsfonts/cm/cmr17.pfb> -<C:/Program Files (x86)/MiKTeX 2.9/fonts/type1/public/amsfonts/cm/cmr7.pfb><C:/ -Program Files (x86)/MiKTeX 2.9/fonts/type1/public/amsfonts/cm/cmr8.pfb><C:/Prog -ram Files (x86)/MiKTeX 2.9/fonts/type1/public/amsfonts/cm/cmsltt10.pfb><C:/Prog -ram Files (x86)/MiKTeX 2.9/fonts/type1/public/amsfonts/cm/cmti10.pfb><C:/Progra -m Files (x86)/MiKTeX 2.9/fonts/type1/public/amsfonts/cm/cmtt10.pfb> -Output written on dataRetrieval.pdf (21 pages, 288533 bytes). +00\tctt1095.pk> <C:\Users\ldecicco\AppData\Local\MiKTeX\2.9\fonts\pk\ljfour\jkn +appen\ec\dpi600\tcst1095.pk><C:/Program Files (x86)/MiKTeX 2.9/fonts/type1/publ +ic/amsfonts/cm/cmbx10.pfb><C:/Program Files (x86)/MiKTeX 2.9/fonts/type1/public +/amsfonts/cm/cmbx12.pfb><C:/Program Files (x86)/MiKTeX 2.9/fonts/type1/public/a +msfonts/cm/cmmi10.pfb><C:/Program Files (x86)/MiKTeX 2.9/fonts/type1/public/ams +fonts/cm/cmr10.pfb><C:/Program Files (x86)/MiKTeX 2.9/fonts/type1/public/amsfon +ts/cm/cmr12.pfb><C:/Program Files (x86)/MiKTeX 2.9/fonts/type1/public/amsfonts/ +cm/cmr17.pfb><C:/Program Files (x86)/MiKTeX 2.9/fonts/type1/public/amsfonts/cm/ +cmr7.pfb><C:/Program Files (x86)/MiKTeX 2.9/fonts/type1/public/amsfonts/cm/cmr8 +.pfb><C:/Program Files (x86)/MiKTeX 2.9/fonts/type1/public/amsfonts/cm/cmsltt10 +.pfb><C:/Program Files (x86)/MiKTeX 2.9/fonts/type1/public/amsfonts/cm/cmti10.p +fb><C:/Program Files (x86)/MiKTeX 2.9/fonts/type1/public/amsfonts/cm/cmtt10.pfb +> +Output written on dataRetrieval.pdf (21 pages, 290588 bytes). PDF statistics: - 287 PDF objects out of 1000 (max. 8388607) - 48 named destinations out of 1000 (max. 500000) - 148 words of extra memory for PDF output out of 10000 (max. 10000000) + 300 PDF objects out of 1000 (max. 8388607) + 49 named destinations out of 1000 (max. 500000) + 156 words of extra memory for PDF output out of 10000 (max. 10000000) diff --git a/inst/doc/dataRetrieval.pdf b/inst/doc/dataRetrieval.pdf index cc98338382e0bbd08fbdceaea352f8fc0fde5f36..779299b5e1fdddab9fea96c4b219732f39e43078 100644 Binary files a/inst/doc/dataRetrieval.pdf and b/inst/doc/dataRetrieval.pdf differ diff --git a/inst/doc/dataRetrieval.synctex.gz b/inst/doc/dataRetrieval.synctex.gz index 02b36626118d004e28a5048c54467b41d06cd17b..36568d724ad12d0d7576143c2c59ed52ea2f6a8b 100644 Binary files a/inst/doc/dataRetrieval.synctex.gz and b/inst/doc/dataRetrieval.synctex.gz differ diff --git a/inst/doc/dataRetrieval.tex b/inst/doc/dataRetrieval.tex index e3cd2243f44aa69207a9db3307d3197a0e4a74a1..1e305048004d2f4527970d89198f9de2e4437c36 100644 --- a/inst/doc/dataRetrieval.tex +++ b/inst/doc/dataRetrieval.tex @@ -79,7 +79,7 @@ Once the site-ID is known, the next required input for USGS data retrievals is t % latex table generated in R 2.15.2 by xtable 1.7-0 package -% Wed Jan 30 16:51:39 2013 +% Tue Feb 05 15:37:17 2013 \begin{table}[ht] \begin{center} \caption{Commonly found USGS Parameter Codes} @@ -102,7 +102,7 @@ For real-time data, the parameter code and site ID will suffice. The USGS store The most common stat codes are: % latex table generated in R 2.15.2 by xtable 1.7-0 package -% Wed Jan 30 16:51:39 2013 +% Tue Feb 05 15:37:17 2013 \begin{table}[ht] \begin{center} \caption{Commonly found USGS Stat Codes} @@ -134,7 +134,7 @@ To obtain all of the available site information, use the getSiteFileData functio % latex table generated in R 2.15.2 by xtable 1.7-0 package -% Wed Jan 30 16:51:40 2013 +% Tue Feb 05 15:37:18 2013 \begin{tabular}{rllll} \hline & ColumnNames & ColumnNames.1 & ColumnNames.2 & ColumnNames.3 \\ @@ -293,12 +293,12 @@ Which produces the following dataframe: \begin{Schunk} \begin{Soutput} agency_cd site_no datetime tz_cd X02_00060 X02_00060_cd -1 USGS 01491000 2013-01-29 00:00:00 EST 138 P -2 USGS 01491000 2013-01-29 00:15:00 EST 135 P -3 USGS 01491000 2013-01-29 00:30:00 EST 135 P -4 USGS 01491000 2013-01-29 00:45:00 EST 135 P -5 USGS 01491000 2013-01-29 01:00:00 EST 135 P -6 USGS 01491000 2013-01-29 01:15:00 EST 140 P +1 USGS 01491000 2013-02-04 00:00:00 EST 175 P +2 USGS 01491000 2013-02-04 00:15:00 EST 175 P +3 USGS 01491000 2013-02-04 00:30:00 EST 178 P +4 USGS 01491000 2013-02-04 00:45:00 EST 178 P +5 USGS 01491000 2013-02-04 01:00:00 EST 178 P +6 USGS 01491000 2013-02-04 01:15:00 EST 178 P \end{Soutput} \end{Schunk} @@ -345,7 +345,7 @@ There is a large amount of data returned for each observation. The column names % latex table generated in R 2.15.2 by xtable 1.7-0 package -% Wed Jan 30 16:51:43 2013 +% Tue Feb 05 15:37:22 2013 \begin{tabular}{rll} \hline & ColumnNames & ColumnNames.1 \\ @@ -418,6 +418,27 @@ An example of plotting the above data (Figure 3): \caption{Nitrate plot of Choptank River.} \end{figure} +%------------------------------------------------------------ +\subsection{Water Quality Retrievals} +%------------------------------------------------------------ +Additionally, there are additional data sets available on the Water Quality Portal (\url{http://www.waterqualitydata.us/}). These data sets can be housed in either the STORET or NWIS database. Since STORET does not use USGS parameter codes, a 'characteristic name' must be supplied. The following example retrieves specific conductance from a DNR site in Wisconsin. + +\begin{Schunk} +\begin{Sinput} +> specificCond <- getWQPData('WIDNR_WQX-10032762', + 'Specific conductance', '', '') +> head(specificCond) +\end{Sinput} +\begin{Soutput} + dateTime qualifier.Specific conductance value.Specific conductance +1 2011-02-14 1360 +2 2011-02-17 1930 +3 2011-03-03 1240 +4 2011-03-10 1480 +5 2011-03-29 1130 +6 2011-04-07 1200 +\end{Soutput} +\end{Schunk} %------------------------------------------------------------ @@ -443,7 +464,7 @@ The funtion to obtain the daily values (discharge in this case) is getDVData. I Min. :1964-01-01 Min. : 0.00991 Min. :41637 Min. : 1.000 1st Qu.:1976-04-01 1st Qu.: 0.87782 1st Qu.:46112 1st Qu.: 4.000 Median :1988-07-02 Median : 2.26535 Median :50586 Median : 7.000 - Mean :1988-07-02 Mean : 4.01796 Mean :50586 Mean : 6.522 + Mean :1988-07-02 Mean : 4.01787 Mean :50586 Mean : 6.522 3rd Qu.:2000-10-01 3rd Qu.: 4.55901 3rd Qu.:55061 3rd Qu.:10.000 Max. :2013-01-01 Max. :246.35656 Max. :59535 Max. :12.000 @@ -459,20 +480,41 @@ The funtion to obtain the daily values (discharge in this case) is getDVData. I Min. : 1 Min. :-4.6141 Min. : 0.01808 Min. : 0.09606 1st Qu.: 4476 1st Qu.:-0.1303 1st Qu.: 0.92232 1st Qu.: 1.05811 Median : 8950 Median : 0.8177 Median : 2.45143 Median : 2.83074 - Mean : 8950 Mean : 0.7258 Mean : 4.01658 Mean : 4.01178 + Mean : 8950 Mean : 0.7258 Mean : 4.01655 Mean : 4.01178 3rd Qu.:13424 3rd Qu.: 1.5171 3rd Qu.: 4.92309 3rd Qu.: 5.61594 Max. :17899 Max. : 5.5068 Max. :84.00395 Max. :25.47478 NA's :6 NA's :29 \end{Soutput} \end{Schunk} -Date is a column with dates stored in an R Date type. Julian is an integer number of days since January 1, 1850. Month and Day are integers from the start of each year. DecYear is the decimal year. MonthSeq is the (integer) number of months since 1850. Qualifier is the code from NWIS as mentioned in the raw data section. i is a count of observations. LogQ is the natural logarithm of Q. The code will shift the discharge values to 0.001 times the mean if there are zero values detected in order to perform the logarithm. Columns Q7 and Q30 are 7 and 30 day running averages. +% latex table generated in R 2.15.2 by xtable 1.7-0 package +% Tue Feb 05 15:37:28 2013 +\begin{tabular}{rlll} + \hline + & ColumnName & Type & Description \\ + \hline +1 & Date & Date & Date \\ + 2 & Q & number & Discharge in cms \\ + 3 & Julian & number & Number of days since January 1, 1850 \\ + 4 & Month & integer & Month of the year [1-12] \\ + 5 & Day & integer & Day of the year [1-366] \\ + 6 & DecYear & number & Decimal year \\ + 7 & MonthSeq & integer & Number of months since January 1, 1850 \\ + 8 & Qualifier & string & Qualifing code \\ + 9 & i & integer & Index \\ + 10 & LogQ & number & Natural logarithm of Q \\ + 11 & Q7 & number & 7 day running average of Q \\ + 12 & Q30 & number & 30 running average of Q \\ + \hline +\end{tabular}\\* +The code will shift the discharge values to 0.001 times the mean if there are zero values detected in order to perform the logarithm. Columns Q7 and Q30 are 7 and 30 day running averages. The function to obtain sample data from the water quality portal is getSampleData. The arguments for this function are also siteNumber, ParameterCd, StartDate, EndDate, interactive. These are the same inputs as getRawQWData or getQWData as described in the previous section. \begin{Schunk} \begin{Sinput} -> Sample <-getSampleData(siteNumber,parameterCd,startDate, endDate,interactive=FALSE) +> Sample <-getSampleData(siteNumber,parameterCd, + startDate, endDate,interactive=FALSE) > summary(Sample) \end{Sinput} \begin{Soutput} @@ -502,6 +544,29 @@ The function to obtain sample data from the water quality portal is getSampleDat \end{Soutput} \end{Schunk} +% latex table generated in R 2.15.2 by xtable 1.7-0 package +% Tue Feb 05 15:37:29 2013 +\begin{tabular}{rlll} + \hline + & ColumnName & Type & Description \\ + \hline +1 & Date & Date & Date \\ + 2 & ConcLow & number & Lower limit of concentration \\ + 3 & ConcHigh & number & Upper limit of concentration \\ + 4 & Uncen & integer & Uncensored data (1=true, 0=false) \\ + 5 & ConcAve & number & Average concentration \\ + 6 & Julian & number & Number of days since January 1, 1850 \\ + 7 & Month & integer & Month of the year [1-12] \\ + 8 & Day & integer & Day of the year [1-366] \\ + 9 & DecYear & number & Decimal year \\ + 10 & MonthSeq & integer & Number of months since January 1, 1850 \\ + 11 & SinDY & number & Sine of ... \\ + 12 & CosDY & number & Cosine of ... \\ + 13 & Q & number & Discharge in cms \\ + 14 & LogQ & number & Natural logarithm of flow \\ + \hline +\end{tabular} + The function to obtain "metadata", data about the gage station and measured parameters is getMetaData. This function essentially combines getSiteFileData and getParameterInfo, producing one dataframe called INFO. \begin{Schunk} @@ -511,7 +576,7 @@ The function to obtain "metadata", data about the gage station and measured para \end{Schunk} % latex table generated in R 2.15.2 by xtable 1.7-0 package -% Wed Jan 30 16:51:49 2013 +% Tue Feb 05 15:37:30 2013 \begin{tabular}{rll} \hline & ColumnNames & ColumnNames.1 \\ @@ -542,43 +607,6 @@ The function to obtain "metadata", data about the gage station and measured para \\* -\begin{Schunk} -\begin{Sinput} -> Sample <- mergeReport() -\end{Sinput} -\begin{Soutput} - Discharge Record is 17899 days long, which is 49 years - First day of the discharge record is 1964-01-01 and last day is 2013-01-01 - The water quality record has 627 samples - The first sample is from 1973-06-04 and the last sample is from 2012-12-18 - Discharge: Minimum, mean and maximum 0.00991 4.02 246 - Concentration: Minimum, mean and maximum 0.05 1.1 2.4 - Percentage of the sample values that are censored is 0.16 % -\end{Soutput} -\begin{Sinput} -> head(Sample) -\end{Sinput} -\begin{Soutput} - Date ConcLow ConcHigh Uncen ConcAve Julian Month Day DecYear MonthSeq -1 1973-06-04 1.30 1.30 1 1.30 45079 6 155 1973.422 1482 -2 1979-09-25 0.52 0.52 1 0.52 47383 9 268 1979.731 1557 -3 1979-10-24 0.62 0.62 1 0.62 47412 10 297 1979.810 1558 -4 1979-12-05 1.40 1.40 1 1.40 47454 12 339 1979.925 1560 -5 1979-12-21 1.20 1.20 1 1.20 47470 12 355 1979.969 1560 -6 1980-01-24 0.84 0.84 1 0.84 47504 1 24 1980.064 1561 - SinDY CosDY Q LogQ -1 0.4699767 -0.8826788 3.256437 1.180634 -2 -0.9927882 -0.1198812 3.398022 1.223193 -3 -0.9295235 0.3687629 3.199804 1.163089 -4 -0.4547551 0.8906165 2.973269 1.089662 -5 -0.1961425 0.9805754 2.944952 1.080093 -6 0.3925740 0.9197204 10.901986 2.388945 -\end{Soutput} -\end{Schunk} - -The difference between these dataframes, and the dataframes in the previous sections is that ... - - \newpage %------------------------------------------------------------ \section{Retrieving User-Generated Data Files} diff --git a/inst/doc/dataRetrieval.toc b/inst/doc/dataRetrieval.toc index 5e675b55e5c2e1e4567ce86e59750450eba10220..6c3e62ce3909b9d84abd03e8be628dc94534bd2f 100644 --- a/inst/doc/dataRetrieval.toc +++ b/inst/doc/dataRetrieval.toc @@ -7,7 +7,8 @@ \contentsline {subsection}{\numberline {2.4}USGS Daily Value Retrievals}{5}{subsection.2.4} \contentsline {subsection}{\numberline {2.5}USGS Unit Value Retrievals}{7}{subsection.2.5} \contentsline {subsection}{\numberline {2.6}USGS Water Quality Retrievals}{9}{subsection.2.6} -\contentsline {section}{\numberline {3}Polished Data: USGS Web Retrieval Examples}{11}{section.3} +\contentsline {subsection}{\numberline {2.7}Water Quality Retrievals}{11}{subsection.2.7} +\contentsline {section}{\numberline {3}Polished Data: USGS Web Retrieval Examples}{12}{section.3} \contentsline {section}{\numberline {4}Retrieving User-Generated Data Files}{16}{section.4} \contentsline {subsection}{\numberline {4.1}getDailyDataFromFile}{16}{subsection.4.1} \contentsline {subsection}{\numberline {4.2}getSampleDataFromFile}{17}{subsection.4.2} diff --git a/man/getWQPData.Rd b/man/getWQPData.Rd index d18d3b6a229bd8f5ea9f30c0e0b97d6f1a1ad3b7..a3b275d477aa664bc684d798eb3b33d64ddcf9f5 100644 --- a/man/getWQPData.Rd +++ b/man/getWQPData.Rd @@ -9,10 +9,7 @@ \item{siteNumber}{string site number. If USGS, it should be in the form :'USGS-XXXXXXXXX...'} - \item{characteristicName}{string USGS parameter code. - Multiple names can be input with a ';' separator. - Leaving this blank will return all of the measured values - during the specified time period.} + \item{characteristicName}{string} \item{StartDate}{string starting date for data retrieval in the form YYYY-MM-DD.} @@ -43,9 +40,8 @@ } \examples{ # These examples require an internet connection to run -\dontrun{getWQPData('USGS-01594440','Chloride', '', '')} -\dontrun{getWQPData('USGS-05114000','Suspended Sediment Discharge;Suspended sediment concentration (SSC);Suspended sediment discharge', '1975-01-01', '1995-03-31')} -\dontrun{getWQPData('USGS-05114000','00915;00931', '1985-01-01', '1985-04-30', interactive=FALSE)} +getWQPData('USGS-01594440','Chloride', '', '') +getWQPData('WIDNR_WQX-10032762','Specific conductance', '', '') } \keyword{WQP} \keyword{data}