There is a real nice feature of RStudio that allows you to create a html file containing your work — R code and any textual or graphical output.
I’ll illustrate it using the snowfall example from my R by Example book.
1. I create a file with the R code for the snowfall graph.
2. In RStudio, choose Compile Notebook from the File menu.
3. It creates this html file including the R code and the snowfall graph.
This code may help in creating your graph for this week’s assignment. Also, I encourage you to use this Notebook feature — it provides an easy way of sharing R work.