Hannah Rigoni
Hannah Rigoni

Reputation: 1

Loading ggplot2 throwing the Error: package or namespace load failed .... there is no package called ‘colorspace’

I'm trying to run a different package that's dependent on ggplot2. When I load ggplot2 it gives me the error:

library(ggplot2) Error: package or namespace load failed for ‘ggplot2’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]): there is no package called ‘colorspace’

I tried to install colorspace and I got this lovely error:

install.packages("colorspace") ERROR: compilation failed for package ‘colorspace’ Warning in install.packages : installation of package ‘colorspace’ had non-zero exit status'

So I tried installing it after downloading it from http://cran.r-project.org/web/packages/colorspace/index.html. And that still didn't work.

I've also tried closing everything down and reinstalling ggplot2.

I updated R to `R version 4.0.5 (2021-03-31) -- "Shake and Throw" this morning.

Upvotes: 0

Views: 907

Answers (2)

John
John

Reputation: 1

I have had the same problem today updating my R from 3.6.1 to 4.1 and this worked for me:

install.packages("colorspace")

and when R asks

Do you want to install from sources the package which needs compilation? (Yes/no/cancel) 

type no

Upvotes: 0

Zjardyn
Zjardyn

Reputation: 11

Are you in windows, Mac or Linux? For windows users it’s necessary to install Rtools which deals with installing packages from binary. Mac and Linux users should not have this issue.

Upvotes: 1

Related Questions