I would like to apply Blom transformation to all columns but 'ID'. Since they are all numeric, map_if
and is.numeric
do not work here.
library(rcompanion)
data("mtcars")
# Get a list of the columns that I would like to apply the Blom transformation
col_names = colnames(mtcars)
# Create the column ID so each row has a unique identifier
mtcars = mtcars %>% mutate(id = row_number())
What I came up with is:
mtcars = map_if(mtcars, names(.) %in% col_names ~ rcompanion::blom(.x, method = "blom")
But I received an error: ! Can't convert `.f`, a two-sided formula, to a function.