How to use the name of the column I'm currently using in a mutate_at?
问题 I have a datatable with missing data and two columns supposed to help to replace those missing data which looks like : library(data.table) Data = data.table( "H1" = c(NaN,4,NaN), "H2" = c(5,NaN,NaN), "H3" = c(7,NaN,NaN), "Group" = c(1,2,1), "Factor" = c(2,3,4) ) H1 H2 H3 Group Factor 1: NaN 5 7 1 2 2: 4 NaN NaN 2 3 3: NaN NaN NaN 1 4 I would like to use a second dataframe for that Groups = data.table( "H1" = c(1,2,3), "H2" = c(4,5,6), "H3" = c(7,8,9), "Group" = c(1,2,3) ) H1 H2 H3 Group 1: 1