📅  最后修改于: 2022-03-11 14:51:58.808000             🧑  作者: Mango
# load dplyr
library(dplyr)
# Round at first decimal with a mixed df
mydf %>% mutate(across(where(is.numeric), round, 1))
# The two solutions above do the same
mydf %>% mutate(across(where(is.numeric), ~round(., 1)))
mydf %>% mutate_if(is.numeric, round, 1)