ExportMonthlyValuesToCSV: ExportMonthlyValuesToCSV

View source: R/ExportMonthlyValuesToCSV.R

ExportMonthlyValuesToCSVR Documentation

ExportMonthlyValuesToCSV

Description

This function exports monthly values generated by the readNWISstat function in the dataRetrieval package.

Usage

ExportMonthlyValuesToCSV(monthlyValues, fileName, metric = TRUE)

Arguments

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

Details

This function outputs to the working directory. The directory can be set with the setwd command.

This function only supports discharge data.

Examples


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))


Agriculturist/waterDataSupport documentation built on Jan. 28, 2023, 11:43 a.m.