Unable to install ggplot2, existing solutions don't work

When trying to install ggplot2 I get the following code at the end of the installation:

'''

  • 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(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]) :
    there is no package called 'colorspace'
    ERROR: lazy loading failed for package 'ggplot2'
  • removing 'C:/Users/Beefgallo/Documents/R/win-library/3.4/ggplot2'
    In R CMD INSTALL
    Warning in install.packages :
    running command '"C:/PROGRA~1/R/R-34~1.4/bin/x64/R" CMD INSTALL -l "C:\Users\Beefgallo\Documents\R\win-library\3.4" C:\Users\BEEFGA~1\AppData\Local\Temp\RtmpwJMpHe/downloaded_packages/ggplot2_3.3.0.tar.gz' had status 1
    Warning in install.packages :
    installation of package ‘ggplot2’ had non-zero exit status
    '''

I tried following the suggestions in this thread:
https://community.rstudio.com/t/problem-installing-ggplot2-packages/10956/9

including installing ggplot2 with all dependencies, installing the rlang package, installing the latest version or R, nothing works.

Any ideas as to what could be causing this?

Of course you have already installed the package colorspace (?)
What command do you use to install ggplot2 ?
What is the result of the statement sessionInfo() ?

I have tried both
install.packages("ggplot2")
and
install.packages("ggplot2", dependencies = TRUE)

I have not tried installing 'colorspace', but I have now, and that worked!

What is the reason for that? Is it a sub-library of ggplot2 that did not install properly?

I understand that you could install both colorspace andggplot2?
Then your issue is resolved.
Please indicate so by clicking on the relevant button.

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