To run Rmd files above and to compile (knit) them to pdf or other document format, install RStudio > 1.0.
If you are new to R and RStudio, or more generally to programing languages, the following short online material by Jenny Bryan is a good starting point. It will help you streamline your daily workflow. It is important in particular to understand the concept of “working directory” from the earliest stage of your learning.
Need a more comprehensive guidebook? Here is a website I’d recommend:
Because of my intensive using of functions and operators defined in
tidyr, my codes might look obscure for those who learned R years back
and haven’t updated their coding style, and for those who don’t have background
in (relational) database systems. Chapter 5 of Grolemund and Wickham will help.