0

I'm trying to split data

Datasplit <- createDataPartition(tele$Tele, p=0.7, list= FALSE)

But get an error message

Error in createDataPartition(tele$Tele, p=0.8, list = FALSE): y must have at least 2 data points.

What does it mean?

AntoniosK
  • 15,991
  • 2
  • 19
  • 32
  • 1
    duplicate? [How does createDataPartition function from caret package split data?](https://stackoverflow.com/questions/40709722/how-does-createdatapartition-function-from-caret-package-split-data) – pogibas Oct 19 '18 at 10:06
  • Why am I getting the error message? – Chukwuebuka Benedict Oct 19 '18 at 10:17
  • 1
    Since we don't know what your data is, how could we know why you are getting an error message? It seems like you are passing fewer than 2 data points to a function which is expecting at least 2. Please give a [mcve]. See [How to make a great R reproducible example?](https://stackoverflow.com/q/5963269/4996248) for what this would mean in R. – John Coleman Oct 19 '18 at 10:24
  • share `str(tele$Tele)`, it seems that either you have less then 2 `factor levels`, or you have just one observation in `tele` – RLave Oct 19 '18 at 10:29
  • Possible duplicate of [How does createDataPartition function from caret package split data?](https://stackoverflow.com/questions/40709722/how-does-createdatapartition-function-from-caret-package-split-data) – loki Jul 02 '19 at 08:13

0 Answers0