Learn R Programming

countyfloods (version 0.0.2)

get_flow_data: Retrieve discharge data at specified gages

Description

Pulls all discharge data for the specified gage numbers and date range.

Usage

get_flow_data(gages_df, start_date, end_date)

Arguments

gages_df

A dataframe that includes the column site_no, a character vector with USGS gage IDs of stream gage sites to pull.

start_date

Character string with the starting date, using "YYYY-MM-DD" notation.

end_date

Character string with the end date, using "YYYY-MM-DD" notation.

Value

A dataframe with discharge data for each of the specified monitors. This is a dataframe that includes columns for the gage site number, date of each observation, and observed mean daily discharge (cubic feet per second).

See Also

readNWISdv

Examples

Run this code
# NOT RUN {
miami_gages <- get_gages("12086", start_date = "2000-01-01",
                            end_date = "2009-12-31")
miami_flow_data <- get_flow_data(gages_df = miami_gages,
                                 start_date = "2000-01-01",
                                 end_date = "2000-01-31")
# Example using piping
library(dplyr)
miami_flow_data <- get_gages("12086", start_date = "2000-01-01",
                                end_date = "2009-12-31") %>%
                   get_flow_data(start_date = "2000-01-01",
                                 end_date = "2000-01-31")
# }

Run the code above in your browser using DataLab