2

I am using the data found here: https://www.kaggle.com/cdc/behavioral-risk-factor-surveillance-system. In my R studio, I have named the csv file, BRFSS2015. Below is the code I am trying to execute. I am trying to filter two columns.

###For STATE, I want value 42, and for MENTHLTH, I want to exclude values 88,77,99  

BRFSS2015%>%
  select(`_STATE`,MENTHLTH)%>%
  filter(`_STATE`=="42" & MENTHLTH!=c("88","77","99"))

Filter is working for STATE, but not for MENTHLTH. What is wrong in my syntax?

jakdar
  • 77
  • 6

0 Answers0