I am trying to learn from an online example and got stuck on one part. Particularly when i use train() function. I got an error saying train isn't a function. I did research and believe train is a function. The code i copied was : xgb_tree_model = train(SalePrice~., data=train, method="xgbTree", trControl=control, tuneGrid=grid, metric="rmsle", maximize = FALSE)
The site I am using is http://hamelg.blogspot.com/2016/09/kaggle-home-price-prediction-tutorial.html
You can check step by step.
Check if package is installed. Check using following command.
find.package(c("caret"),lib.loc=NULL,quiet=FALSE, verbose = getOption("verbose"))
it will show you package path if found else show you error message.
If package is not installed, install it by using
install.packages("caret")
this will install package.Now load your caret package using
library(caret)
call
train()
function. Now you should not get error message.