12 week 11: R Bootcamp III
Prepare for Class:
- Jockers Chapter 4: this chapter is about using regular expressions in R. However, the function (grep) used by Jockers for regular expressions does not deal well with Arabic-script texts. Peter has created an interactive version of Jockers’ Chapter 4 that uses functions from the stringr package instead. Please work through this interactive tutorial (you can of course still read Jockers’ chapter in parallel): https://pverkind.github.io/RTutorial/4_Regex.html (you can look at Jockers in
- work through chapter 5 in Jockers: this chapter introduces two important programming concepts, “for loops” and “if conditionals”; once you understand these, you will be able to manage working with R on large corpora instead of one text. NB: keep in mind that you may have to use the stringr functions instead of grep for regular expressions if grep does not return the results you expect!
Turn in before class:
- the R script file for the exercise we started in class
- an R script file (“chapter4_
.R”) with the commands of the interactive tutorial exercises for Chapter 4
- an R script file (“chapter5_
.R”) with the commands of Jockers’ chapter 5.
Please use the R_exercises repository on GitHub to submit your R scripts.
- R exercises on Jockers’ chapters 4 and 5
- group work on preparation of the final project