From 6fa8ce259cf2e372b8d9848bb33659bd2e84167c Mon Sep 17 00:00:00 2001 From: unknown <ldecicco@usgs.gov> Date: Thu, 18 Sep 2014 16:21:28 -0500 Subject: [PATCH] Updated help files. --- man/dateFormatCheck.Rd | 2 ++ man/getDataAvailability.Rd | 3 ++- man/getQWDataFromFile.Rd | 5 +++-- man/getSiteFileData.Rd | 5 ++--- vignettes/dataRetrieval.Rnw | 16 ++++++++-------- 5 files changed, 17 insertions(+), 14 deletions(-) diff --git a/man/dateFormatCheck.Rd b/man/dateFormatCheck.Rd index ece1a7ee..5800f638 100644 --- a/man/dateFormatCheck.Rd +++ b/man/dateFormatCheck.Rd @@ -17,6 +17,8 @@ Checks to see if format is YYYY-MM-DD. Also performs a few other date checks. \examples{ date <- '1985-01-01' dateFormatCheck(date) +dateWrong <- '1999/1/7' +dateFormatCheck(dateWrong) } \keyword{WRTDS} \keyword{flow} diff --git a/man/getDataAvailability.Rd b/man/getDataAvailability.Rd index 3e6e2147..805ccf88 100644 --- a/man/getDataAvailability.Rd +++ b/man/getDataAvailability.Rd @@ -20,7 +20,8 @@ Imports a table of available parameters, period of record, and count. # These examples require an internet connection to run availableData <- getDataAvailability('05114000') # To find just unit value ('instantaneous') data: -uvData <- availableData <- getDataAvailability('05114000',type="uv") +uvData <- getDataAvailability('05114000',type="uv") +uvDataMulti <- getDataAvailability(c('05114000','09423350'),type="uv") } \keyword{USGS} \keyword{data} diff --git a/man/getQWDataFromFile.Rd b/man/getQWDataFromFile.Rd index cc00e2c2..4817423c 100644 --- a/man/getQWDataFromFile.Rd +++ b/man/getQWDataFromFile.Rd @@ -26,9 +26,10 @@ be a remark column preceeding. \examples{ # Examples of how to use getQWDataFromFile: # Change the file path and file name to something meaningful: -filePath <- '~/RData/' # Sample format +filePath <- system.file("extdata", package="dataRetrieval") +filePath <- paste(filePath,"/",sep="") fileName <- 'ChoptankRiverNitrate.csv' -\dontrun{rawSampleData <- getQWDataFromFile(filePath,fileName, separator=";")} +rawSampleData <- getQWDataFromFile(filePath,fileName, separator=";") } \keyword{data} \keyword{file} diff --git a/man/getSiteFileData.Rd b/man/getSiteFileData.Rd index 510251a3..6affa0fc 100644 --- a/man/getSiteFileData.Rd +++ b/man/getSiteFileData.Rd @@ -3,12 +3,10 @@ \alias{getSiteFileData} \title{USGS Site File Data Retrieval} \usage{ -getSiteFileData(siteNumber = "", interactive = TRUE) +getSiteFileData(siteNumber) } \arguments{ \item{siteNumber}{string USGS site number. This is usually an 8 digit number} - -\item{interactive}{logical Option for interactive mode. If true, there is user interaction for error handling and data checks.} } \value{ retval dataframe with all information found in the expanded site file @@ -19,6 +17,7 @@ Imports data from USGS site file site. This function gets data from here: \url{h \examples{ # These examples require an internet connection to run siteINFO <- getSiteFileData('05114000') +siteINFOMulti <- getSiteFileData(c('05114000','09423350')) } \keyword{USGS} \keyword{data} diff --git a/vignettes/dataRetrieval.Rnw b/vignettes/dataRetrieval.Rnw index 3d6b42c1..e20955c8 100644 --- a/vignettes/dataRetrieval.Rnw +++ b/vignettes/dataRetrieval.Rnw @@ -23,7 +23,7 @@ \usepackage{csquotes} \usepackage{setspace} -\doublespacing +% \doublespacing \renewcommand{\topfraction}{0.85} \renewcommand{\textfraction}{0.1} @@ -33,7 +33,8 @@ \usepackage{mathptmx}% Times Roman font \usepackage[scaled=.90]{helvet}% Helvetica, served as a model for arial -\usepackage{indentfirst} +% \usepackage{indentfirst} +% \setlength\parindent{20pt} \setlength{\parskip}{0pt} \usepackage{courier} @@ -99,7 +100,7 @@ singlelinecheck=false } -\setlength\parindent{20pt} + \textwidth=6.2in \textheight=8.5in @@ -757,7 +758,7 @@ Finally, qUnit is a numeric argument that defines the discharge units used in th So, if you have a file called \enquote{ChoptankRiverFlow.txt} located in a folder called \enquote{RData} on the C drive (this example is for the Windows\textregistered\ operating systems), and the file is structured as follows (tab-separated): -\singlespacing +% \singlespacing \begin{verbatim} date Qdaily 10/1/1999 107 @@ -768,7 +769,7 @@ date Qdaily 10/6/1999 98 ... \end{verbatim} -\doublespacing +% \doublespacing The call to open this file, convert the discharge to cubic meters per second, and populate the Daily data frame would be: <<openDaily, eval = FALSE>>= @@ -787,7 +788,6 @@ Microsoft\textregistered\ Excel files can be a bit tricky to import into R direc \label{sec:SampleFile} %------------------------------------------------------------ -\doublespacing The \texttt{getSampleDataFromFile} function will import a user-generated file and populate the Sample dataframe. The difference between sample data and discharge data is that the code requires a third column that contains a remark code, either blank or \verb@"<"@, which will tell the program that the data were \enquote{left-censored} (or, below the detection limit of the sensor). Therefore, the data must be in the form: date, remark, value. An example of a comma-delimited file is: \singlespacing @@ -800,7 +800,6 @@ cdate;remarkCode;Nitrate 2/3/2000,,1.54 ... \end{verbatim} -\doublespacing The call to open this file, and populate the Sample dataframe is: <<openSample, eval = FALSE>>= @@ -823,7 +822,8 @@ date rdp dp rpp pp rtp tp 2005-10-30 < 0.020 ... \end{verbatim} -\doublespacing + + <<openSample2, eval = FALSE>>= fileName <- "ChoptankPhosphorus.txt" filePath <- "C:/RData/" -- GitLab