So, first off I tried using this function:
## Install packages
#ipak function: install and loads multiple R packages
packages<-c("ggplot2", "psych", "nlme", "pracma", "corrplot", "lattice", "R2HTML", "zoo", "psy", "dplyr")
##
ipak<- function(pkg){
new.pkg<-pkg[!(pkg %in% installed.packages()[, "Package"])]
if(length(new.pkg))
install.packages(new.pkg, dependencies=TRUE)
sapply(pkg, requrie, character.only=TRUE) }
ipak(packages)
##
## This looks in and loads the libraries
for(pkg in packages) library(pkg, chracter.only=T)
seemed to install and load the packages with no problem. I normally am working with R in the lab so these packages are already installed and just get loaded but because of the virus I am doing work at home. So I don't get these issues normally in lab. I was running my script and came across an error saying that there was no package called dplyr.
So I went and checked my library to see - indeed all of the other packages are installed, just not dplyr.
I first try to install tidyverse in entirety using the install.package function. All get installed except dplyr.
I try installing dplyr separately using the install.package function and it appears to install. It looks like it is trying to create a random folder in win-lib since there is no path specified. Fine, as long as it's installed.
I try to load dplyr from my library..and I get the error "there is no package called 'dplyr'".
Uhm...ok? So I attempted to install via the package tab on RStudio. It, again, appears to work. But now when I try to load the library I get an error reading "there is no package called 'purrr'" but nowhere in my code am I trying to install something called purrr..
What's going on? I'm using the most current version of R, or so I believe. Just having a problem troubleshooting this. EDIT: I see, purrr is a dependency. Any reason why this is the only one not installing?
EDIT: output of install.packages("dplyr") reads:
https://cran.rstudio.com/bin/windows/Rtools/
Installing package into 'C:/Users/Mona/Documents/R/win-library/3.6'
(as 'lib' is unspecified)
output of installed.packages("dplyr"):
Package LibPath Version Priority Depends Imports LinkingTo Suggests Enhances License License_is_FOSS License_restricts_use OS_type Archs MD5sum NeedsCompilation Built