So I cannot get certain packages to load on R, but when I go to a Windows based OS they work fine. My statistics teacher said R is glitchy on Mac, but I'm wondering if anyone knows how to get these packages to work on R.
This error message: Error in ... : could not find function "xyplot" (same with ggplot)
ggplot
ggplot2
Anyone else have issues like this with Mac?
Most packages should work normally on MacOS, including ggplot2
What error message do you get while installing the package in your MacOS?
install.packages("ggplot2", dependencies = TRUE)
What error message do you get while loading the library?
library(ggplot2)
One or more of the packages that will be updated by this installation are currently loaded. Restarting R prior to updating these packages is strongly recommended.
RStudio can restart R and then automatically continue the installation after restarting (all work and data will be preserved during the restart).
Do you want to restart R prior to installing?
Yes. (R restarts)
Error in ggplot2(logmod) : could not find function "ggplot2"
ggplot2
is the name of the package, not of the function, also you need to load the library on each new R session to be able to use it, see this example.
# Load the library
library(ggplot2)
ggplot(data = iris, aes(x = Species, y = Sepal.Width)) +
geom_col()
Created on 2019-04-07 by the reprex package (v0.2.1.9000)
library(ggplot2)
Error in ggplot2(logmod) : could not find function "ggplot2"
Still giving me the same message
Could you post a screenshot of your code and error message?
So it finally worked! Thank you. I had to restart it and reinstall it, then restart it again, then it worked.
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.