Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to install Caret package? While installing, I am getting this message

library(caret)

Loading required package: ggplot2 Error: package or namespace load failed for ‘ggplot2’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]): there is no package called ‘gtable’ Error: package ‘ggplot2’ could not be loaded

like image 889
Venkatesh Saravanakumar Avatar asked Jun 18 '17 16:06

Venkatesh Saravanakumar


People also ask

What is the caret package?

The caret package (short for Classification And REgression Training) contains functions to streamline the model training process for complex regression and classification problems.

How long does it take to install caret?

it took about 10 minutes.

What is the use of caret package in R?

Caret is a one-stop solution for machine learning in R. The R package caret has a powerful train function that allows you to fit over 230 different models using one syntax. There are over 230 models included in the package including various tree-based models, neural nets, deep learning and much more.

What is caret in RStudio?

Caret is one of the most powerful and useful packages ever made in R. It alone has the capability to fulfill all the needs for predictive modeling from preprocessing to interpretation. Additionally, its syntax is also very easy to use. If you use R, I'll encourage you to use Caret.


2 Answers

Try this...

install.packages('caret', dependencies = TRUE)
like image 52
pyll Avatar answered Nov 15 '22 08:11

pyll


I had the same issue (R 3.5 for Windows).

Just had to keep going installing the missing dependencies until everything installed (for me there were about 10 dependencies missing)

This even required changing to a different mirror when the files could not be found!

Hope this helps someone in future...

> install.packages('caret', dependencies = TRUE)
> library('caret')
Loading required package: ggplot2 Error: package or namespace load failed for ‘ggplot2’ in loadNamespace(i, c(lib.loc, .libPaths()), versionCheck = vI[[i]]): there is no package called ‘gtable’ Error: package ‘ggplot2’ could not be loaded
> install.packages('gtable', dependencies = TRUE)
> install.packages('ggplot2', dependencies = TRUE)
> library('caret')
Error: package or namespace load failed for ‘caret’ in loadNamespace(j <- i[[1L]], c(lib.loc, .libPaths()), versionCheck = vI[[j]]):
 there is no package called ‘gower’
> install.packages('gower', dependencies = TRUE)
...
like image 45
IanS Avatar answered Nov 15 '22 08:11

IanS