Help with ggplot2

HI all,

I am completely new to R, have previously been working with STATA, so forgive me my ignorance.
I am trying to install the tidyverse package, but are experiencing issues with the ggplot2 package and gives me the following message when i run:

install.packages("ggplot2", dependencies = TRUE)
Installing package into ‘C:/Users/brfdk/Documents/R/win-library/3.3’
(as ‘lib’ is unspecified)
also installing the dependency ‘rlang’

There are binary versions available but the source
versions are later:
binary source needs_compilation
rlang 0.2.0 0.3.0.1 TRUE
ggplot2 2.2.1 3.1.0 FALSE

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

package ‘rlang’ successfully unpacked and MD5 sums checked

The downloaded binary packages are in
C:\Users\brfdk\AppData\Local\Temp\RtmpwveHUm\downloaded_packages
installing the source package ‘ggplot2’

trying URL 'https://cran.rstudio.com/src/contrib/ggplot2_3.1.0.tar.gz'
Content type 'application/x-gzip' length 2863109 bytes (2.7 MB)
downloaded 2.7 MB

  • installing source package 'ggplot2' ...
    ** package 'ggplot2' successfully unpacked and MD5 sums checked
    ** R
    ** data
    *** moving datasets to lazyload DB
    ** inst
    ** preparing package for lazy loading
    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
    ERROR: lazy loading failed for package 'ggplot2'
  • removing 'C:/Users/brfdk/Documents/R/win-library/3.3/ggplot2'
    Warning in install.packages :
    running command '"C:/PROGRA~1/R/R-33~1.3/bin/x64/R" CMD INSTALL -l "C:\Users\brfdk\Documents\R\win-library\3.3" C:\Users\brfdk\AppData\Local\Temp\RtmpwveHUm/downloaded_packages/ggplot2_3.1.0.tar.gz' had status 1
    Warning in install.packages :
    installation of package ‘ggplot2’ had non-zero exit status

I now, that there has already been written a lot on this topic, but I can't manage to get it to work.

So any help is highly appreciated.

Thanks,
Mads

Maybe this is the source of your problem? Does it work is you install rlang separately first?

It looks like you're on Windows, have you installed Rtools?

It shouldn't matter for installing ggplot2 and rlang You should still be able to install rlang and ggplot2 for 3.3, but you might also consider upgrading your version of R, since 3.3 is about a year and a half old, at this point (see also @jcblum's point re. binaries, below) .

1 Like

It might help a little in the sense of making installation easier. The Windows binary of rlang available for the current R release (R 3.5) and the last R release before that (R 3.4) is rlang version 0.3.0.1, so if you were running updated R, I believe a compatible version of rlang would install with no compilation (or RTools) necessary.

Binaries have to be compiled separately against different major versions of R. CRAN does not have the resources to keep compiling binaries against all older versions of R indefinitely as packages get updated. The current policy:

Binary packages are built for the current version of R: they may also be built for the last version in the previous series (e.g. R 3.1.3 when R 3.2.x is current) or for R-devel.

So R 3.3 has fallen out of the window of ever receiving updated binary packages, being more than 1 step older than the current R 3.5.

2 Likes

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