Hi @shohreh,
I'm not sure I completely understand your question but here is a simple dplyr way to modify the contents of multiple data frame columns, depending on the content of the units column.
suppressPackageStartupMessages(library(tidyverse))
(df <- data.frame(units = c("%","%","raw","raw","%"),
aa = c(20,15,0.6,0.5,40),
bb = c(10,12,0.4,0.7,28)))
#> units aa bb
#> 1 % 20.0 10.0
#> 2 % 15.0 12.0
#> 3 raw 0.6 0.4
#> 4 raw 0.5 0.7
#> 5 % 40.0 28.0
df %>%
mutate_at(vars(-units), ~ifelse(units=="%", ./100, .))
#> units aa bb
#> 1 % 0.20 0.10
#> 2 % 0.15 0.12
#> 3 raw 0.60 0.40
#> 4 raw 0.50 0.70
#> 5 % 0.40 0.28
Created on 2021-07-20 by the reprex package (v2.0.0)
Hopefully this gets you closer to a solution.
See here for other examples:
https://stackoverflow.com/questions/64337331/mutate-at-or-across-and-ifelse-statement