All the fun functions are in packages
R is considered an Open Source software program. That means many (thousands) of people contribute to the software. They do this by writing commands (called functions) to make a particular analysis easier, or to make a graphic prettier.
When you download R, you get access to a lot of functions that we will use. However these other user-written packages add so much good stuff that it really is the backbone of the customizability and functionality that makes R so powerful of a language.
For example we will be creating graphics using functions like
hist() that exist in base R. But you will quickly move on to creating graphics using functions contained in the
ggplot2 package. We will be managing data using functions in
dplyr and reading in Excel files using
readxl. Installing packages will become your favorite past-time.
✏️ Start by typing the following in the console to install the
When the download and install is complete, you should see a message similar to:
⚠️ R is case sensitive and spelling matters. If you get an error message like the following:
The correct package name is
Alternative Method of installing Packages: Use the Package tab in the lower right pane in R Studio.
Keep an eye on the messages that fly by in the console. You are looking for key words such as “error code” or “unable to remove…” to indicate installation problems.
When you see a chevron
> in the console you know R is done installing and waiting for you.
⚠️ Check with your instructor about which packages to install. You typically do NOT need all of these.
Data Import and Management
tidyverse(an opinionated collection of packages that work well together
Communication / pretty reporting
rmarkdownliterate data analysis and creating reports, presentations, websites.
ggplot2(also contained in tidyverse)
corrplotvisualizing correlation matricies
micemultiple imputation with chained equations
VIMvisualizing missing data patterns,