Error: could not find function "sample.split"



I am currently solving one classification problem for which I am trying to split the training data into training and testing of my model for which I am using the sample.split function but I am getting the error.

sample_0 = sample.split(train_0, SplitRatio = .9) 
Error: could not find function "sample.split"


Have you imported the caTools library?


You have to download and include the library caTools before executing sample split.


I am facing the same problem on my mac. I have imported caTools library and checked for its presence too. But when i check whether sample.split is defined, it shows “False”. Any possible solution for this?


I encountered the same problem. After installing the package caTools, make sure you load its library as well before running the code.