edquant / edh7916

Course materials and website for EDH7916: Contemporary Research in Higher Education
https://edquant.github.io/edh7916/
3 stars 1 forks source link

Multiple Criteria in string detect statement? #35

Closed nszekeres closed 4 years ago

nszekeres commented 4 years ago

@btskinner - General Question...

How do you make a str_detect statement that captures multiple criteria? -- the below did not work:

## df_joined %>%
##  distinct(CHFNM) %>%
##  filter(xor(str_detect(CHFNM, "Dr"), str_detect(CHFNM, "Dr."), str_detect(CHNFM, "DR"))) %>%
## arrange (CHFNM)

Or, is there a way to use a "starts with" function with a filter, like we do on "select"?

nszekeres commented 4 years ago

@btskinner - whoops! Don't answer that - had not looked at the Bonus Q; I figured it out. :)