Troubleshooting for R, RStudio, and Tidyverse installation

In this site, I hope to address most of the issues that appear when we try to install R, RStudio, and tidyverse in the classroom setting.

Why doesn’t my R look like your R [software]?

There are two programs to install: R, then RStudio. Please follow the installation instructions at https://dsollberger.netlify.com/post/r-installation-for-students/

RStudio says that it cannot find the R binaries.

There are two programs to install: R, then RStudio. Please follow the installation instructions at https://dsollberger.netlify.com/post/r-installation-for-students/

We cannot install software (on iPad, Chromebook, etc.)

There is a fantastic alternative at RStudio Cloud. That is, one can do their R programming online. There will be a few more steps involved compared to what we do in RStudio Desktop, but past students have gotten RStudio Cloud to work.

tidyverse cannot be found

We need to install code packages before using code packages. Run install.packages("tidyverse") in the console (lower-left area). The installation will take up to 5 minutes. This has to be done only once during the semester.

[package] is not available for R version …

To ensure compatibility between R and code packages, the R community almost always asks users to use the newest version of R. Please install the newest versions of R and RStudio. This semester we are using R version 3.6.2 and RStudio version 1.2.5033.

there is no package ‘rlang’

Run this command in the console

  • install.packages("dplyr")

If a choice appears that says something like Do you want to install from sources the package which needs compilation?., select “No”.

Alternatively: https://stackoverflow.com/questions/49721356/trouble-downloading-rlang-with-tidyverse

there is no package ‘broom’

The explanation would be a deep dive into the notion of dependencies (beyond the scope of the course). For now, we dive right into this case’s dependencies. Run these commands in the console.

If a choice appears that says something like Do you want to install from sources the package which needs compilation?., select “No”.

  • install.packages("backports")
  • then install.packages("zeallot")
  • then install.packages("broom")
  • then install.packages("tidyverse")

Sources:

rlang and/or broom still do not work

Let’s try this. tidyverse is a set of packages that are supposed to work together well and emulate programming practices from other programming languages. In our introductory forays into R programming, we do not need every package in the tidyverse. Therefore, the simplest work-around is to load the needed packages individually.

#### instead of library("tidyverse") ####
library("dplyr")    #for the pipe function %>% and other SQL commands
library("ggplot2")  #modern data visualization
#library("readr")    #to load CSV data files
#library("readxl")   #to load Excel data files
#library("stringr")  #manipulate strings and regular expressions
#library("tidyr")    #to reshape data frames with functions like gather or spread

How do we know which is the RMD file and which is the HTML file?

It will be useful if you can see file types in your computer.

Also, the HTML file will probably have a similar icon as your web browser (Chrome, Firefox, etc.)