Skip to content

Commit

Permalink
Modified an example to include a demo and blurb on character case sen…
Browse files Browse the repository at this point in the history
…sitivity to fix #305
  • Loading branch information
ytakemon committed Nov 12, 2024
1 parent 9954090 commit 590068a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions episodes/01-r-basics.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -751,12 +751,15 @@ the vector you are searching:
# current value of 'snp_genes':
# chr [1:7] "OXTR" "ACTN3" "AR" "OPRM1" "CYP1A1" NA "APOA5"
# test to see if "ACTN3" or "APO5A" is in the snp_genes vector
# test to see if "ACTN3", "APO5A", or "actn3" is in the snp_genes vector
# if you are looking for more than one value, you must pass this as a vector
c("ACTN3","APOA5") %in% snp_genes
c("ACTN3","APOA5", "actn3") %in% snp_genes
```

Notice that the gene "actn3" is FALSE? This is because character vectors are case sensitive, so
keep this in mind when subsetting and selecting values from a character vector.

::::::::::::::::::::::::::::::::::::::::: callout

## Tip: What's the difference between the `%in% and the `==` operators?
Expand Down

0 comments on commit 590068a

Please sign in to comment.