Hello, I am trying to use ggplot2 and cannot install the package correctly in Rstudio (Windows). When I try load the package it reads:
Error: package or namespace load failed for ‘ggplot2’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called ‘crayon’
When I try to install crayon I get this error:
Installing package into ‘C:/Users/david/Documents/R/win-library/4.1’
(as ‘lib’ is unspecified)
There is a binary version available but the source version is later:
binary source needs_compilation
crayon 1.4.2 1.5.0 FALSE
The downloaded source packages are in
‘C:\Users\david\AppData\Local\Temp\RtmpOELFMb\downloaded_packages’
Warning message:
In install.packages("crayon") :
installation of package ‘crayon’ had non-zero exit status
The easiest solution is to install the binary version.
Your are trying to install from source which requires compilation and the process is failing. I suspect you have omitted a portion of the console output because there is not much information on what you have posted, can you post the complete console output you get?
library(ggplot2)
Error: package or namespace load failed for ‘ggplot2’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
there is no package called ‘crayon’
install.packages("crayon")
Installing package into ‘C:/Users/david/Documents/R/win-library/4.1’
(as ‘lib’ is unspecified)
There is a binary version available but the source
version is later:
binary source needs_compilation
crayon 1.4.2 1.5.0 FALSE