I want to perform head/tails
classification to data.frame
and I'd like to set the number of classes to 7 but I can't. The classes are set automatically to either 2 or 14. I tried different parameters like the n = 7
and thr = from 0 to 1
, without success. How can I set the number of classes to 7? Here is the code and the data.
library(classInt)
block.data = read.csv("path/values.csv")
vec1 <- block.data$X4
print(classIntervals(vec1, n = 7, style = "headtails", thr = 1))
The dataset I am sharing (20 values) is a really small subset of my original data.frame
(>10K values) and it can be classified into 5 classes, while my original data.frame
can be classified into 2 or 14 classes.
c(4.15732383728027, 4.64473390579224, 5.13697910308838, 5.62461566925049,
6.08347082138062, 6.09681606292725, 5.98013210296631, 5.85955047607422,
5.74385595321655, 5.69291543960571, 5.80153608322144, 5.94426155090332,
6.10236692428589, 6.24384021759033, 4.13175535202026, 4.61712312698364,
5.10912799835205, 5.60870552062988, 6.10747909545898)
It's not possible for a user to set the number of classes using the head/tails
classification, according to the author of the classInt
package.