You may not need 1-3 immediately to solve your problem, but the OSx setup should be
- Mojave
- XCode
- XCode command line utilities
- R from from https://cran.r-project.org (currently 3.6.0) (take the default location) and install the pkg
- RStudio from https://www.rstudio.com/products/rstudio/download/#download in your Applications folder after installing the package
When you want to install a specific package, you have four choices; one each from the menubars for RStudio and R and one each from the console > lines in each
install.packages("tidyverse") # packages is plural, and the library name is in quotes
# but when you load the library `library(tidyverse) no quotes
update.packages() will install later versions..
Sometimes you see "version X is later do you want to install from source"? If it doesn't work the first time, it's not going to work until a binary version comes out 7-10 days later.