tidyverse, ggplot2 loadNamespace error

ggplot2
tidyverse
rlang

#1

similar post to a number of others.

tidyverse install returns error about rlang not being 0.2.1. So I uninstall/remove [rlang] install it again and it just reinstalls 0.2.0 again.

Any ideas how to install a specific version of [rlang] ?

install.packages("tidyverse", dependencies = TRUE)
library(tidyverse)

Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
namespace 'rlang' 0.2.0 is being loaded, but >= 0.2.1 is required


#2

You got the correct fix. You need to update rlang (or downgrade tidyverse)

Try updating rlang using remotes::update_packages("rlang"). It may ask you to build from source if no binary is available.


#3

This question seems to be related to @serge’s other question here, so I’m adding that link for context:


#4

thanks for the response

I ran the [rlang] updated as suggested. It says that there is a later source version but seems to default to the 0.2.0 compiled binary instead.

when I try <library(tidyverse)> I get "object 'vI' not found"

It I try the same update approach for [tidyverse] (and select updated [rlang]) I still get the same error. seems I am in a recursive error loop.

outputs..

>remotes::update_packages("rlang")
Installing 1 packages: rlang
Installing package into ‘C:/Users/MetaBox/Documents/R/win-library/3.3’
(as ‘lib’ is unspecified)

  There is a binary version available but the source version is later:
      binary  source needs_compilation
rlang  0.2.0 0.3.0.1              TRUE

  Binaries will be installed
trying URL 'https://cran.rstudio.com/bin/windows/contrib/3.3/rlang_0.2.0.zip'
Content type 'application/zip' length 754726 bytes (737 KB)
downloaded 737 KB

>remotes::update_packages("tidyverse")
package ‘tidyselect’ successfully unpacked and MD5 sums checked
package ‘glue’ successfully unpacked and MD5 sums checked
package ‘rlang’ successfully unpacked and MD5 sums checked
package ‘tidyr’ successfully unpacked and MD5 sums checked

>library(tidyverse)
Error in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) : 
  object 'vI' not found
Error: package or namespace load failed for ‘tidyverse’

#5

The default behavior of install.packages() (which remotes::update_packages() relies on under the hood) varies by operating system. On Windows, if R is not offering to install from source for packages that need to be compiled, then you should verify that you have the RTools installed and configured correctly.

You can force installation from source with:

install.packages("rlang", type = "source")

(Or pass "source" as the type parameter to remotes::update_packages())

But again, this will not work unless you have the RTools correctly installed.

To learn more about how all this works, see: