Error Loading ggplot on new Mac

Hello, I have been trying to get an assignment done and I keep getting the following error.

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

It keeps saying colorspace is not available for use when I try to download or load ggplot. I have downloaded R and re downloaded it, and tried to update everything. Nothing has worked. When I uninstall the package and reinstall it, I get the following error,

This does not let me download the software or do anything with the command line tools for xcode.

I am trying to run the code below, but it will not let me cause it says I do not have the gg plot package. But I cannot download the ggplot package because my mac wont let me download the software, because it says I don’t need it anymore. Its an endless cycle.

ggplot(mydata, aes(x=dem, y=fdiinflead)) +geom_point(na.rm = T) + 
  geom_smooth(method = "lm", se = FALSE, color = 'red',na.rm = T) + 
  theme(plot.title = element_text(hjust = 0.5)) +
  labs(title="Scatter Plot", 
       x="Democracy Scores", y="FDI Inflow in Billions (USD)")

Does anyone have a solution to this problem?

You have to install this missing dependency


If you are asked to install from source, the easiest choice would be to answer no, otherwise, you would need to install the command line developer tools and the recommended development tools for macOS systems.

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

If you have a query related to it or one of the replies, start a new topic and refer back with a link.