I received an error similar to what was listed above. I realized that I had forgotten to change my variable in the code listed below
split = sample.split(dataset$Profit,
from profit to units sold (variable in my actual data set) vs. profit which was code from another project. Hope this helps - I listed the rest of my code and my errors below.
> library(caTools)
> set.seed(123)
> split = sample.split(dataset$Profit, SplitRatio = .8)
Error in sample.split(dataset$Profit, SplitRatio = 0.8) :
Error in sample.split: 'SplitRatio' parameter has to be i [0, 1] range or [1, length(Y)] range
> training_set = subset(dataset, split == TRUE)
Error in split == TRUE :
comparison (1) is possible only for atomic and list types
> test_set = subset(dataset, split == FALSE)
Error in split == FALSE :
comparison (1) is possible only for atomic and list types