calculate_stats_diffs: Function to calculate the differences in statistics for two...

Description Usage Arguments Details Value Examples

Description

This function accepts two data frames of daily flow data and returns a data frame of calculated difference statistics from calc_allHIT, calc_magnifSeven, calculate_other_flow_stats, and calculate_GoF_stats. HitStats, calc_magnifSeven, and other_flow_stats are differented as (a-b)/a

Usage

1
2
calculate_stats_diffs(sites, flow_data_a, flow_data_b, yearType = "water",
  digits = 3)

Arguments

sites

A two column dataframe containing site names for flow_data_a and flow_data_b flow data.

flow_data_a

A dataframe containing a NWCCompare flow dataset. Should have been cleaned by validate_data and constructed by a build dataset function from this package.

flow_data_b

A second NWCCompare flow dataset to be compared to flow_data_a.

yearType

A charcter of either "water" or "calendar" indicating whether to use water years or calendar years, respectively.

digits

A numeric. Number of digits to round indice values

Details

Assumptions: Dates must match between the two data sources.

Value

statsout data frame of calculated statistics

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# https://cida.usgs.gov/nwc/#!waterbudget/achuc/031300011004
nwis <- "02335757"
huc <- "031300011004"
sites <- data.frame(a=nwis, b=huc, stringsAsFactors = FALSE)
start_date <- "2004-10-01"
end_date <- "2010-09-30"
flow_data_a <- build_nwis_dv_dataset(nwis, start_date, end_date)
flow_data_b <- build_nwc_flow_dataset(huc, start_date, end_date)
diff_statsout <- calculate_stats_diffs(sites = sites, 
  flow_data_a = flow_data_a, 
  flow_data_b = flow_data_b, 
  yearType = "water",
  digits = 2) 

USGS-R/NWCCompare documentation built on May 9, 2019, 6:10 p.m.