Learn R Programming

tidywater (version 0.7.0)

solvecost_chem: Determine chemical cost

Description

This function takes a chemical dose in mg/L, plant flow, chemical strength, and $/lb and calculates cost.

Usage

solvecost_chem(dose, flow, strength = 100, cost, time = "day")

Value

A numeric value for chemical cost, $/time.

Arguments

dose

Chemical dose in mg/L as chemical

flow

Plant flow in MGD

strength

Chemical product strength in percent. Defaults to 100 percent.

cost

Chemical product cost in $/lb

time

Desired output units, one of c("day", "month", "year"). Defaults to "day".

Examples

Run this code
alum_cost <- solvecost_chem(dose = 20, flow = 10, strength = 49, cost = .22)

library(dplyr)
cost_data <- tibble(
  dose = seq(10, 50, 10),
  flow = 10
) %>%
  mutate(costs = solvecost_chem(dose = dose, flow = flow, strength = 49, cost = .22))

Run the code above in your browser using DataLab