Skip to content
Course Notes: Intermediate R
Course Notes
Use this workspace to take notes, store code snippets, and build your own interactive cheatsheet!
# Import any packages you want to use here
vec.test <- c("alphabet", "betabet", "saskia")
grepl(pattern = "^a", x = vec.test)
### "^a" indicates the first letter is an "a" #####
grepl(pattern = "a$", x = vec.test)
### "a$" indicates the last letter is an "a" ####
### grep itself gives the indices of the position of the words in the vector where the pattern occurs ###
grep(pattern = "a", x = vec.test)Take Notes
Add notes here about the concepts you've learned and code cells with code you want to keep.
Add your notes here
# Add your code snippets here