How Do I add column to data frame that uses a mathematical equation with variables from the existing columns?

Viewed 29
  1. I have df that contains columns "Value" and "Max Value"
  2. I add a column to my df using mutate()
  3. I need the new column to output based on the equation output=119[(Max Value/value)-1]^1.231
1 Answers

We may do

library(dplyr)
df <- df %>%
    mutate(output = 119 * ((`Max Value`/Value)-1)^1.231)
Related