Skip to contents

Calculate a time series of concentration values from time series of load and discharge.

Usage

load_to_conc(
  load,
  flow,
  load_unit = "kg day-1",
  flow_unit = "m3 s-1",
  out_unit = "mg L-1"
)

Arguments

load

Data frame with a date column and one or many columns with load values. The number of load columns must be the same as the number of discharge columns in the data frame flow.

flow

Data frame with a date column and one or many columns with discharge values. The number of flow columns must be the same as the number of load columns in the data frame load.

load_unit

Unit of the load values provided as a text string in the format 'mass time-1. Default is 'kg day-1'.

flow_unit

Unit of the discharge values provided as a text string in the format 'volume time-1. Default is 'm3 s-1'.

out_unit

Unit of the concentration values provided as a text string in the format 'mass volume-1. Default is 'mg L-1'.

Value

A table with date column and calculated concentration values.

Examples

if (FALSE) {
# Example usage:
date_load <- seq(as.Date('2000-01-01'), as.Date('2000-12-31'), by = '2 week')
date_flow <- seq(as.Date('2000-01-01'), as.Date('2000-12-31'), by = 'day')

l_df <- data.frame(date = date_load,
                   value = runif(length(date_load)))

f_df <- data.frame(date = date_flow,
                   value = runif(length(date_flow)))

conc <- load_to_conc(load = l_df, flow = f_df, load_unit = 'tons day-1')
}