I wanted to select all the columns (col2,col3,col4,col5,col6) excpet (col1,col2) that equal to 2
the first image shows the raw data
the second image show what I wanted to do
and I have used dplyr package for this purpose but it did not work
could you please help me to fix this problem
here you can find the r code:
library(dplyr)
df<- read.csv("temp.csv")
df2<- df %>% filter_at(vars(names(df[,c(2:5)])),all_vars(.==2))
I got the following result: