Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hello,
i already integrated R in Qlik Sense and used the k-means algorithm for clustering the Iris Dataset. That works perfekt, when i do it in the diagram.
When i write the following Code, R returns: "Rserve Traceback: stop("more cluster centers than distinct data points.")".
When i use the same k-means-command to color the scatter plot, it works fine.
This is my script:
[Iris]:
LOAD
observation,
"sepal length" as seplen,
"sepal width" as sepwid,
"petal length" as petlen ,
"petal width" as petwid
FROM [lib://Data/Iris.csv];
[KMeans]:
Load
observation as observation,
petlen as petlen,
petwid as petwid,
R.ScriptEval('kmeans(cbind(q$petlen, q$petwid), 2 , nstart = 10)$cluster ;', petlen , petwid)
Resident [Iris] ;
Any help is appreciated.