-2

I am trying to filter an observation in RStudio. For some reason, the string is not being recognized when I try to filter the data. I am trying to filter Cell A12 (pictured) in R. I go to my dataset, copy and paste the exact values in R, but it is not being recognized.

Filter -

RMM_cleaned %>% filter(Disease == "Campylobacteriosis ENTERIC"
)

To which I receive

# A tibble: 0 × 2
# ℹ 2 variables: Disease <chr>, Alarm # <chr>

I am confused as to why the filter (as well as some other work in the script) are not recognizing the cells that have a line of text separated from another line of text. Is this some weird format or something? Is there a way I can extract the obs based on the text from the cell? Not sure if hyperlinks are a source of the problem either, the text does have a hyperlinked cell.

Any knowledge/guidance is appreciated.

Thanks.

r2evans
  • 141,215
  • 6
  • 77
  • 149
  • 3
    Please read [1](https://stackoverflow.com/help/how-to-ask) how do I ask a good question and [2](https://stackoverflow.com/help/minimal-reproducible-example) or [3](https://stackoverflow.com/a/5963610/5784831) how to provide a minimal reproducible example in R. Then we can help you. – Christoph Aug 10 '23 at 17:14
  • 2
    Common causes of this include: case difference, extra spaces (anywhere), accents (UTF-8, unicode, something else), or simply typos. Look _closely_ at your real data and find the small difference in the data that is causing problems. It might be informative to look at the return from something like `grep("enteric", RMM_cleaned$Disease, ignore.case = TRUE, value = TRUE)` to see what values in the column contain "enteric" in any form. (Feel free to finesse that `grep` pattern if that is too generic.) – r2evans Aug 10 '23 at 17:27

0 Answers0