View source: R/ExportMonthlyValuesToCSV.R
| ExportMonthlyValuesToCSV | R Documentation |
This function exports monthly values generated by the readNWISstat function in the dataRetrieval package.
ExportMonthlyValuesToCSV(monthlyValues, fileName, metric = TRUE)
monthlyValues |
daily values output by the importDVs in the waterData package |
fileName |
file name to save CSV file to |
metric |
if TRUE the output is in metric units |
This function outputs to the working directory. The directory can be set with the setwd command.
This function only supports discharge data.
site = list(
staid = "02131000", # site number
code = "00060", # code for discharge
stat = "00003", # code for mean
)
MonthlyValues <- readNWISstat(StationInfo$siteID,
parameterCd = StationInfo$site$code,
statReportType = "monthly")
ExportDailyMonthlyToCSV(MonthlyValues,
paste0("Monthly_Values_for_Site_", site$staid))
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.