We are going to be covering a lot in our R sessions, so to give us a jump start, I’ve compiled some things you should have done before coming:
tidyverse
packages (Update tidyverse
packages)IMPORTANT!:
If you have any problems installing the software or packages, please contact me before class so we can sort out any problems
Please complete the RStudio Programming Basics Primer.
You can complete it online and it’ll give you a quick introduction to R coding which is will be a great way to get up to speed on the basics before we jump in.
Feel free to run through other RStudio Primers.
Even if you already have R installed, please update it, so we’re all working with the same version
Depending on your operating system, you can install R in one of the following ways:
Windows
Mac
Linux: Debian/Ubuntu
Even if you already have RStudio installed, please update it, so we’re all working with the same version
Open RStudio not R
. RStudio automatically opens R for you in the ‘Console’ pane
Verify that your version of R by looking at the first line of the console (left or lower left pane), you should see something like this:
## R version 4.1.2 (2021-11-01) -- Bird Hippie
## Copyright (C) 2021 The R Foundation for Statistical Computing
## Platform: x86_64-pc-linux-gnu (64-bit)
##
## R is free software and comes with ABSOLUTELY NO WARRANTY.
## You are welcome to redistribute it under certain conditions.
## Type 'license()' or 'licence()' for distribution details.
##
## Natural language support but running in an English locale
##
## R is a collaborative project with many contributors.
## Type 'contributors()' for more information and
## 'citation()' on how to cite R or R packages in publications.
##
## Type 'demo()' for some demos, 'help()' for on-line help, or
## 'help.start()' for an HTML browser interface to help.
## Type 'q()' to quit R.
The important line is the first one: R version 4.1.2 (2021-11-01) – Bird Hippie
tidyverse
packagePackages are extensions or add-ons for R. You will use many different ones over the course of your work with R. tidyverse
is name of a collection of newer packages for data management.
In RStudio:
* DONE (tidyverse)
The downloaded source packages are in
‘/tmp/RtmpACWq9S/downloaded_packages’
>
library("tidyverse")
into the console and hitting enter. You should see something like this (Note: These are messages, not errors!):library("tidyverse")
Problems?
- If you already had R/RStudio installed, try removing them both and installing everything from scratch
- If you get an error about a problem installing a specific package, try installing that package invidiually (search for it in the install packages menu)
- Try installing the packages we need by hand:
dplyr
,tidyr
,readr
,ggplot2
,skimr
- Contact Steffi
tidyverse
This is only necessary if you already have a version of tidyverse
installed.
In RStudio:
We’ll also be using a couple of other packages that are not included in the tidyverse
so let’s make sure you have them installed. We will be using more packages than this, but this will get you ready for the first labs.
palmerpenguins
janitor
readxl
You can install them the same way you installed tidyverse
OR you can use the command line and type the following into the console:
install.packages(c("palmerpenguins", "janitor", "readxl"))
Congratulations! Now you’re ready to get into the fun stuff :)