Hello everyone,
I would like to create multiple columns with a function that divides each row value with the rowSum using across
the table has three numeric columns x,y, and z and another column called totals which is the rowSums(x:z)
table %>% mutate(across(.cols = c(x,y,z),
.fns = .col/.$totals, .names = "{.col}_perc"))
any help possible.
PS. its my first post here so forgive anything not clear in the question. i hope to learn more as I interact here