I would like to select all numeric variables as well as some variables by name. I have managed to use select_if to get the numeric variables and select to get the ones by name but can't combine the two into one statement
x = data.table(c(1,2,3),c(10,11,12),c('a','b','c'),c('x','y','z'), c('l', 'm','n'))
I want my result to be:
V1 V2 V4 V5
1 10 x l
2 11 y m
3 12 z n
I tried this but it doesn't work
y = x %>%
select_if(is.numeric, V4, V5)