I am new to using R Studio on my Macbook Pro Mid 2012 running R Studio. Mac OSX 10.15.7. This is first time using this for my MBA class and never used R Studio or R prior to this class.
I have tried to download caret onto R Studio, but am having an error message.
Can somebody please assist in telling me how to get caret installed? Is there system limitations or some type of error message? Please see attached photos.
Try running install.packages("ggplot2") in the console. Also, note the warning message, which suggests you should probably upgrade to the current version of RStudio.
installing source package ‘ggplot2’ ...
** package ‘ggplot2’ successfully unpacked and MD5 sums checked
** using staged installation
** R
** data
*** moving datasets to lazyload DB
** inst
** byte-compile and prepare package for lazy loading
Error in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]) :
there is no package called ‘munsell’
Calls: ... loadNamespace -> withRestarts -> withOneRestart -> doWithOneRestart
Execution halted
ERROR: lazy loading failed for package ‘ggplot2’
removing ‘/Library/Frameworks/R.framework/Versions/4.2/Resources/library/ggplot2’
Warning in install.packages :
installation of package ‘ggplot2’ had non-zero exit status
The downloaded source packages are in
‘/private/var/folders/67/h64hl6t117q0x0wh2pvld7g40000gn/T/RtmpCXuWPb/downloaded_packages’
Warning message:
R graphics engine version 15 is not supported by this version of RStudio. The Plots tab will be disabled until a newer version of RStudio is installed.
that is my error message.
I cannot upgrade to a new R version due to my laptop?
I believe you are correct. The current version of RStudio needs macOS 12 or higher. That should not stop you from using the version you have, but you apparently will not be able to see plots in the Plots tab.
This is surprising. The issue here seems to be dependencies: caret requires ggplot2 (and maybe other libraries), ggplot2 requires munsell (and maybe other libraries), and so on. The install.packages() command should be installing the dependencies but is not. You can try install.packages("ggplot2", type = "mac.binary") and see if that works better. Updating your operating system might help if it is possible.
This all looks normal. You apparently are missing quite a few packages that are needed (or at least desired). The messages here indicate about 15 of them were downloaded. The question is whether the rest were downloaded and, importantly, whether they installed successfully.
Try install.packages("caret", dependencies = TRUE, type = "mac.binary"). This may reinstall the caret package, and hopefully (maybe) (possibly) will install its various dependencies.
It sounds like you're having trouble installing the caret package in R Studio. The error with ggplot2 might indicate missing dependencies or compatibility issues. Make sure you have the latest version of R and RStudio installed. Try updating ggplot2 first with install.packages('ggplot2'), then install caret again. If you still encounter issues, check the error message for more details or consult the RStudio community forums for specific help.