Learn R Programming

countyfloods (version 0.0.2)

county_aggregates2: Get county level output from

Description

Function aggregates gage-level output into county-level output. This is the same as the county_aggregates function but it summarizes by county and date range instead of just county.

Usage

county_aggregates2(flood_stats, county_cd)

Arguments

flood_stats
Data frame of gage-level output from flood_analysis function.
county_cd
Character vector with the county FIPS code(s)

Value

A data frame with the following columns:
Name Type Description
county_cd character FIPS code of gage county location
start_date date Input start date
end_date date Input end date
county character County name
state character State name
num_gage numeric Number of analyzed gages in county
max_peak numeric Maximum observed flood ratio
avg_peak numeric Average flood ratio among county gages
minor numeric Percentage of gages at or above "minor" flood class (flood ratio > 1)
moderate numeric Percentage of gages at or above "moderate" flood class (flood ratio > 1.5)
major numeric Percentage of gages at or above "major" flood class (flood ratio > 2)
extreme numeric Percentage of gages at or above "extreme" flood class (flood ratio > 5)
max_dur numeric Maximum flood duration in county

If threshold = "NWS", the columns "minor", "moderate", "major", and "extreme" are replaced with two columns: "no_flood" and "yes_flood" which show the percentage of gages in the county with or without flooding.

Internal function used within long_term_flood function.