Looks like the dependency issue that it looks like a lot of people have.
I reinstalled RStudio then downloaded tidyverse with this:
install.packages("tidyverse", dependencies = TRUE )
Then I tried to open the tidyverse using:
library(tidyverse)
It told me it needed Haven so I tried to install that, and then it told me I needed readr so I tried to install that but it wouldn't.
So, now I'm stuck. I'm pretty new at all this and it's v off-putting. I was working away/learning some stuff now I'm losing whole chunks of a day by not being able to get the software to work.
Can anyone point me in the right direction?
Here's the code version:
> library(tidyverse)
Error: package or namespace load failed for ‘tidyverse’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called ‘haven’
> install.packages("haven")
Installing package into ‘C:/Users/Antony.LAPTOP/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
There is a binary version available but the source version is later:
binary source needs_compilation
haven 1.1.2 2.0.0 TRUE
installing the source package ‘haven’
trying URL 'https://cran.rstudio.com/src/contrib/haven_2.0.0.tar.gz'
Content type 'application/x-gzip' length 204563 bytes (199 KB)
downloaded 199 KB
ERROR: dependency 'readr' is not available for package 'haven'
* removing 'C:/Users/Antony.LAPTOP/Documents/R/win-library/3.5/haven'
In R CMD INSTALL
Warning in install.packages :
installation of package ‘haven’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\Antony.LAPTOP\AppData\Local\Temp\Rtmpm4urVj\downloaded_packages’
> install.packages("readr")
Installing package into ‘C:/Users/Antony.LAPTOP/Documents/R/win-library/3.5’
(as ‘lib’ is unspecified)
There is a binary version available but the source version is later:
binary source needs_compilation
readr 1.1.1 1.2.1 TRUE
installing the source package ‘readr’
trying URL 'https://cran.rstudio.com/src/contrib/readr_1.2.1.tar.gz'
Content type 'application/x-gzip' length 358690 bytes (350 KB)
downloaded 350 KB
ERROR: failed to lock directory 'C:/Users/Antony.LAPTOP/Documents/R/win-library/3.5' for modifying
Try removing 'C:/Users/Antony.LAPTOP/Documents/R/win-library/3.5/00LOCK-readr'
In R CMD INSTALL
Warning in install.packages :
installation of package ‘readr’ had non-zero exit status
The downloaded source packages are in
‘C:\Users\Antony.LAPTOP\AppData\Local\Temp\Rtmpm4urVj\downloaded_packages’