Calculate flow from field measurements. All measurements are in meters and meters per second. The final flow measurement is reports as cms and cubic feet per second (cfs). Generates error message for blank (null) entries for inputs for Lateral Location, Depth, and Velocity. In addition it checks for samples with more than one channel but have the same Channel Number.

FlowSum(
  df,
  df.names = c("SITEYR", "ChannelNum", "Lat_Loc_m", "Depth_m", "Velocity_m_s"),
  returnType = "sample"
)

Arguments

df

Data frame of data to be processed. Must include the columns specified in the parameter df1.names.

df.names

Column names; Optional. Defaults = c("SITEYR", "ChannelNum", "Lat_Loc_m", "Depth_m", "Velocity_m_s")

returnType

Returns the original data with cell velocity (cell) or a summary table of the sample velocities (sample); "sample" is the default.

Value

Returns the requested dataframe; the original data with the discharge by cell or by sample (default).

Details

No special libraries are needed for this function.

Examples

# calculate flow
flow.cell <- FlowSum(MBSS.flow, returnType = "cell")
flow.sample <- FlowSum(MBSS.flow)
# examine data
#View(flow.cell)
#View(flow.sample)
# Example Save file (tab delimited text file)
#datetime <- format(Sys.time(), "%Y%m%d_%H%M%S")
#myYear <- "15"
#write.table(flow.sample
#           , paste0("SumFlow", myYear, "_", datetime, ".tab")
#           , row.names=FALSE,sep="\t")