Skip to content
Snippets Groups Projects
Commit 49bb6781 authored by Laura A DeCicco's avatar Laura A DeCicco
Browse files

Updated vignette.

parent 94a9e9e2
No related branches found
No related tags found
1 merge request!39Overhaul of function names. Move some functionality to EGRET.
......@@ -30,4 +30,6 @@ Suggests:
testthat
LazyLoad: yes
LazyData: yes
VignetteBuilder: knitr
BuildVignettes: true
Additional_repositories: http://usgs-r.github.com
......@@ -258,120 +258,11 @@ nrow(dischargeWI)
# characteristicName="pH")
#
## ----ThirdExample-----------------------------------------
parameterCd <- "00618"
INFO <- getNWISInfo(siteNumber,parameterCd, interactive=FALSE)
## ----WQPInfo, eval=FALSE----------------------------------
# parameterCd <- "00618"
# INFO_WQP <- getWQPInfo("USGS-01491000",parameterCd)
## ----addInfo, eval=TRUE, echo=TRUE------------------------
INFO$riverInfo <- "Major tributary of the Chesapeake Bay"
INFO$GreensboroPopulation <- 1931
## ----firstExample-----------------------------------------
siteNumber <- "01491000"
startDate <- "2000-01-01"
endDate <- "2013-01-01"
# This call will get NWIS (ft3/s) data , and convert it to m3/s:
Daily <- getNWISDaily(siteNumber, "00060", startDate, endDate)
## ----colNamesDaily, echo=FALSE,results='asis'-------------
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 m$^3$/s", "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", "Qualifying code", "Index of days, starting with 1", "Natural logarithm of Q", "7 day running average of Q", "30 day running average of Q")
Units <- c("date", "m$^3$/s","days", "months","days","years","months", "character","days","numeric","m$^3$/s","m$^3$/s")
DF <- data.frame(ColumnName,Type,Description,Units)
print(xtable(DF, caption="Daily dataframe",label="tab:DailyDF1"),
caption.placement="top",
size = "\\footnotesize",
latex.environment=NULL,
sanitize.text.function = function(x) {x},
sanitize.colnames.function = bold.colHeaders,
sanitize.rownames.function = addSpace
)
## ----secondExample----------------------------------------
parameterCd <- "00618"
Sample <-getNWISSample(siteNumber,parameterCd,
startDate, endDate)
## ----STORET,echo=TRUE,eval=FALSE--------------------------
# site <- 'WIDNR_WQX-10032762'
# characteristicName <- 'Specific conductance'
# Sample <-getWQPSample(site,characteristicName,
# startDate, endDate)
## ----label=tab:exampleComplexQW, echo=FALSE, eval=TRUE,results='asis'----
cdate <- c("2003-02-15","2003-06-30","2004-09-15","2005-01-30","2005-05-30","2005-10-30")
rdp <- c("", "<","<","","","")
dp <- c(0.02,0.01,0.005,NA,NA,NA)
rpp <- c("", "","<","","","")
pp <- c(0.5,0.3,0.2,NA,NA,NA)
rtp <- c("","","","","<","<")
tp <- c(NA,NA,NA,0.43,0.05,0.02)
DF <- data.frame(cdate,rdp,dp,rpp,pp,rtp,tp,stringsAsFactors=FALSE)
xTab <- xtable(DF, caption="Example data",digits=c(0,0,0,3,0,3,0,3),label="tab:exampleComplexQW")
print(xTab,
caption.placement="top",
size = "\\footnotesize",
latex.environment=NULL,
sanitize.colnames.function = bold.colHeaders,
sanitize.rownames.function = addSpace
)
## ----thirdExample,echo=FALSE------------------------------
compressedData <- compressData(DF)
Sample <- populateSampleColumns(compressedData)
## ----thirdExampleView,echo=TRUE---------------------------
Sample
## ----openDaily, eval = FALSE------------------------------
# fileName <- "ChoptankRiverFlow.txt"
# filePath <- "C:/RData/"
# Daily <-getFileDaily(filePath,fileName,
# separator="\t")
## ----openSample, eval = FALSE-----------------------------
# fileName <- "ChoptankRiverNitrate.csv"
# filePath <- "C:/RData/"
# Sample <-getUserSample(filePath,fileName,
# separator=",")
## ----openSample2, eval = FALSE----------------------------
# fileName <- "ChoptankPhosphorus.txt"
# filePath <- "C:/RData/"
# Sample <-getUserSample(filePath,fileName,
# separator="\t")
## ----mergeExample-----------------------------------------
siteNumber <- "01491000"
parameterCd <- "00631" # Nitrate
startDate <- "2000-01-01"
endDate <- "2013-01-01"
Daily <- getNWISDaily(siteNumber, "00060", startDate, endDate)
Sample <- getNWISSample(siteNumber,parameterCd, startDate, endDate)
Sample <- mergeReport(Daily,Sample)
names(Sample)
## ----helpFunc,eval = FALSE--------------------------------
# ?removeDuplicates
# ?getNWISPcodeInfo
## ----rawFunc,eval = TRUE----------------------------------
removeDuplicates
getNWISPcodeInfo
## ----seeVignette,eval = FALSE-----------------------------
# vignette(dataRetrieval)
......
This diff is collapsed.
No preview for this file type
File added
File added
File added
File added
File added
File added
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment