Unable to Install ggplot2 on RStudio

I just started using R x64 3.6.1. I use a PC with Windows10 64 bit OS. I am able to install "tidyverse" and "rlang" but when I install ggplot2 and execute it, I get the following error,

library(ggplot2) Error: package or namespace load failed for ‘ggplot2’ in inDL(x, as.logical(local), as.logical(now), ...): unable to load shared object 'C:/Users/welcome/Documents/R/win-library/3.6/colorspace/libs/x64/colorspace.dll': LoadLibrary failure: %1 is not a valid Win32 application.

I downloaded 'Rtools' and installed it but still the same error.
I checked. 'colorspace.dll' has a size of 56.5 kB. I followed the default file settings that was recommended by the system when I installed R.

I also tried the following:
install.packages("ggplot2", dependencies = TRUE, repos = "http://cran.us.r-project.org")

I got the same error message. I uninstalled R and R Studio and installed it again.

What am I doing wrong? How do I correct this? Please advise.

thank you.

A possibility is that you installed a 32-bit version of RStudio. I no longer have a wintel box, so I can't check for what you should see, but I suggest taking a look at the About menu item to see if it provides a clue.

I did check. I have RStudio Version 1.2.5019 installed and R3.6.1-Win [both R x64 & R i386] installed on my pc.
Windows 10 is also 64 bit.

I have even uninstalled and reinstalled R and RStudio multiple times and still the same error.

What do you think?


Have you tried removing/reinstalling the colorspace package?

1 Like

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