str(update_columns(iris, 1L, as.factor))
str(update_columns(iris, c("Sepal.Width", "Petal.Length"), "as.integer"))
## Apply log transformation to all columns
summary(airquality)
summary(update_columns(airquality, names(airquality), log))
## Force set factor to numeric
df <- data.frame("a" = as.factor(sample.int(10L)))
str(df)
str(update_columns(df, "a", function(x) as.numeric(levels(x))[x]))
Run the code above in your browser using DataLab