I have 2 dataframes,
df1 <- data.frame(a = c(1,2,3,4,9), b = c(1,2,3,4,5) , c = c(1,2,3,4,9), d = c(1,2,3,4,5) )
df2 <- data.frame( c = c(1,2,3,4,5) ,a = c(1,2,3,4,5) )
I want to drop all column names of df2 from df1
Something like that below (but not working)
df1[, -colnames(df2)]