What You Should Know For Lecture: Week 7

Monday:

Announcements-

Any exercises not completed in class will be due Wednesday at 11 pm.

Projects

If you need help, or just want to share your progress, please come to office hours or chat with us during class about your projects.

We have added a folder of test script bits in the Term_project folder. Check it out! Could be super helpful.


Fantastic R resources:

This one is great for shiny project people

https://bookdown.org/yihui/rmarkdown/notebook.html

This is great for learning the tidyverse

https://r4ds.had.co.nz/


Today in class

Today in class you are going go through several R tutorials to learn about using R notebooks in R studio, the basics of the tidyverse, and how to play with data in the tidyverse.

http://www.storybench.org/getting-started-r-rstudio-notebooks/

http://www.storybench.org/getting-started-with-tidyverse-in-r/

http://www.storybench.org/how-to-explore-a-dataset-from-the-fivethirtyeight-package-in-r/

There is a problem with the fivethirtyeight tutorials

For the code:

murders_final_sort %
  arrange(
    change)
murders_final_sort

Use this instead:

murders_final_sort <- murders_final %>%
  arrange(
    change)
murders_final_sort

For the code:

midpts <- barplot(murders_final_sort$change,
                  cex.axis = 1.0, cex.names = 0.6,
                  ylim = c(-20, 120), main = "Change in murders from 2014 to 2015"
)

text(murders_final_sort$city,
     x = midpts,
     offset = -0.1,
     y = -20,
     cex = 0.5,
     srt = 60,
     xpd = TRUE,
     pos = 2
)

Use this instead:

midpts <- barplot(murders_final_sort$change,
                  cex.axis = 1.0, cex.names = 0.6,
                  ylim = c(-20, 120), main = "Change in murders from 2014 to 2015"
)

text(murders_final_sort$city_state,
     x = midpts,
     offset = -0.1,
     y = -20,
     cex = 0.5,
     srt = 60,
     xpd = TRUE,
     pos = 2
)

In class exercises

Make R notebooks for each of the three tutorials. Name these tutorials:

_R_notebook.Rmd

_getting_started_tidyverse.Rmd

_fivethirtyeight.Rmd

Copy these R notebook files to the ~/classdata/In_class/Week7/Monday directory