Packages not loading since updating RStudio

I updated R studio and R to be consistent with the versions used when some scripts I was given were written. I initially discovered problems just with installing dplyr and tidyr with the updated version of R (R-3.4.2), but I am now having trouble opening many packages, even when I open Rstudio with the version of R that was previously working (R-3.3.3).

Here are some outputs I am getting related to the problem (in R-3.3.3):

>.libPaths()
[1] "C:/Program Files/R/R-3.3.3/library"
> library(tidyr)
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) : 
  there is no package called ‘pillar’
Error: package or namespace load failed for ‘tidyr’

Additionally, when ever I try to install or update packages currently, RStudio throws a window that says "One or more of the packages that will be updated by this installation are currently loaded. Restarting R prior to updating these packages is strongly recommended. Rstudio can restart R and then automatically continue to the installation after restarting.... Do you want to restart R prior to installing?" with options "yes", "no" and "cancel". I have tried all three options for installing tidyr to no avail.

The most frustrating thing is that it seems like what is not working keeps expanding. At first it was just in R version 3.4.2, and then it was just the Hadley-verse packages, but now knitr won't load.

Thank you for any help!

Try updating your packages with update.packages(checkBuilt = TRUE) after restarting your R session with Ctrl + Shift + F10, also make sure that you are not sharing the same libPath for R 3.3.3 and 3.4.2 if you are going to use both

Hi andrescs, thanks for your help!

I confirmed that .libpath() for both is separate, going to 2 separate folders named 'C:\Program Files\R\R-3.X.X\library', respectively.

For R-3.3.3, I have a folder named "tidyr" that has updated content since I last executed an update. I ran

> install.packages('tidyr', `update.packages(checkBuilt = TRUE)

and was prompted to hit "Y" for a number of packages and updates but the updates froze when it got to 'tidyr'. I let it try to finish updating for several minutes but seemed permanently frozen as I've seen before.

For R-3.4.2, I do not even have a folder named "tidyr", but instead I have a list of folders named something like "file77d413ac7710" that corresponds to each time I have tried to install tidyr while running this version of R.

Inside there is a folder named "BH" and inside that a list of 4 folders and a handful of files. When I compare this to the contents of the 'tidyr'-folder in R-3.3.3, all the folders in the R-3.4.2 tidyr folder are in the R-3.3.3 folder but R-3.3.3 has a few ('data', 'demo','doc', and 'R'). Also, R-3.3.3 does not have an intermediate "BH" folder.

I noticed part of the error message when installation of 'tidyr' freezes is saying that "Rtools" is not installed. So I tried installing 'Rtools', but got a message saying Rtools is not available for R-3.4.2... I got a similar error message when I downloaded another package ('cowplot'), but that installation still completed without freezing my lap top.

Any other ideas or help would be greatly appreciated - thank you

Rtools is not an R package you have to download and install it from here

https://cran.r-project.org/bin/windows/Rtools/

You can also try uninstalling and re installing dplyr

remove.packages('tidyr')
install.packages('tidyr', repos='http://cran.rstudio.com/')

Do you have any particular reason for updating to R 3.4.2 instead of the latest version (3.5.3)? Usually the binary packages (the ones that doesn't need compiling) are just available for the latest versions and they are easier to install.

So I'm thinking this is a tidyr problem and not an Rstudio problem afterall. I completely uninstalled all versions of R and RStudio, and (re)installed RStudio and R-3.5.3. knitr, ggplot2, and lme4 all install with no issues, but tidyr and anything that loads anything with tidy in the name (tidyverse, tidyselect (in dplyr)) causes RStudio to freeze - even when using the 'repos=' command you suggested.

Anyway, I'm moving over to the tidyverse github community to see if anyone there has an idea what might be happening - thanks again for your (very prompt!) advice.

Issue resolved -

After a complete uninstall/reinstall of RStudio and R, installation was still freezing whenever I tried to install anything with tidyr included. It was freezing at the transition to the unpacking stage.

In the R console (RGui, not RStudio), I was finally able to get installation of 'tidyr' to complete by letting the computer sit even though the "not responding" banner was showing. I did this twice (in R-3.5.3 and R-3.4.2, each time taking ~25 minutes). The second time it actually froze while unpacking 'R6' while all other installs seemed to freeze while unpacking 'utf8'.

More of the troubleshooting process is described at the git tidyr community - https://github.com/tidyverse/tidyr/issues/609

Thanks again for your help, andresrcs!

If your question's been answered (even by you!), would you mind choosing a solution? It helps other people see which questions still need help, or find solutions if they have similar problems. Here’s how to do it:

1 Like

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.