Skip to content

List of R packages for PQHS/CRSP/MPHP 431 with Professor Thomas Love at Case Western Reserve University

Notifications You must be signed in to change notification settings

THOMASELOVE/431-packages

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 

Repository files navigation

431-packages

These instructions are meant to be used after you've completed the installation of R and RStudio, as described in the Software section of our main course website.

R Packages to Install for 431

An R "package" is a collection of functions, data, and documentation that extends the capabilities of R, and is the critical way to get R doing interesting work. These package instructions should be used after you've installed R and RStudio. We will add packages to this list as the semester continues.

  1. Open RStudio. Copy and paste the following lines of code into the Console window of RStudio to install a few key packages.
pkgs <-  c( "broom", "car", "emmeans", "Epi", "fivethirtyeight", "GGally", "ggdist", "ggpubr", "glue", "haven", "infer",
            "janitor", "knitr", "medicaldata", "mice", "MKinfer", "naniar", "olsrr", "palmerpenguins", "patchwork",
            "readxl", "rstanarm", "styler", "tidytuesdayR", "xfun",
            "easystats", "tidyverse")

install.packages(pkgs)
  1. Execute those commands by hitting Enter.

  2. Now, go to the Packages tab on the right side of your RStudio screen, and click on Update. (This is also how you'll Update packages later this term.)

  3. This will bring up a dialog box. I usually click Select All, then click Install Updates.

  • A popup box may appear, asking "Do you want to install from sources the packages which need compilation?" to which I usually answer No. A Yes response leads to a slower installation, but can solve problems if you still have them after updating.
  • This may take a few minutes. As long as you're seeing activity in the Console window, things are progressing.
  • Eventually, you'll get a message that "The downloaded source packages are in ..." with a directory name. That's the sign that the updating is done.
  • Updating packages is something you'll do occasionally throughout the semester, mostly when a problem happens.
  1. Finally, choose File ... Quit Session from the top menu, and accept or deny (I usually deny) RStudio's request to save your workspace.

Note: A Windows Issue

If you are using Windows, and get messages during installation that the latest version of RTools needs to be installed, you can usually just ignore them. If you don't want to ignore them, go here to download and install RTools for Windows.

Contents of the Tidyverse and Easystats Meta-Packages

Installing a Single Package

If you want to install a single package, you can do so by finding the word Packages on the right side of your RStudio screen.

  1. Click on the Packages tab to start installing the packages you'll need.
  2. Click Install, which will bring up a dialog box, where you can type in the names of the packages that you need. These should be separated by a space or comma. Be sure to leave the Install dependencies box checked.
    • A popup box may appear, asking "Do you want to install from sources the packages which need compilation?" to which I usually answer No. A Yes response leads to a slower installation, but can solve problems if you still have them after updating.
    • This may take a few minutes. As long as you're seeing activity in the Console window, things are progressing.
    • Eventually, you'll get a message that "The downloaded source packages are in ..." with a directory name. That's the sign that the updating is done.

Click here to return to the main website for the course.

About

List of R packages for PQHS/CRSP/MPHP 431 with Professor Thomas Love at Case Western Reserve University

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published