logoalt Hacker News

latent-persontoday at 3:17 AM0 repliesview on HN

You should look into dplyr [1] (part of the tidyverse) in R to see how intuitive this can get. You can do math directly on columns:

  df |> dplyr::mutate(profit = Amount * Price - Losses)
For Julia, take a look at TidierData.jl [2], which provides similar tidy syntax via macros.

[1] https://dplyr.tidyverse.org/

[2] https://tidierorg.github.io/TidierData.jl/latest/