powered by
This function calculates the percentage of sodium (Na
calculate_Napercent(df, convert_units = FALSE)
A numeric vector containing Na percent values.
A dataframe containing the necessary columns.
Logical indicating whether to convert values from mg/l to meq/l.
df <- data.frame(Ca = c(10, 20, 30), Mg = c(5, 10, 15), Na = c(15, 25, 35), K = c(3, 5, 6)) calculate_Napercent(df, convert_units = TRUE)
Run the code above in your browser using DataLab