Timo Becker
2006-Apr-07 07:02 UTC
[R] cclust causes R to crash when using manhattan kmeans
Dear R users, When I run the following code, R crashes: require(cclust) x <- matrix(c(0,0,0,1.5,1,-1), ncol=2, byrow=TRUE) cclust(x, centers=x[2:3,], dist="manhattan", method="kmeans") While this works: cclust(x, centers=x[2:3,], dist="euclidean", method="kmeans") I'm posting this here because I am not sure if it is a bug. I've been searching for a manhattan kmeans method and I found a solution by using the package amap: require(amap) Kmeans(x, x[2:3,], method="manhattan") This works for me, so I don't need the cclust package anymore. Anyway, I wanted to report the cclust behaviour. R version 2.2.1, 2005-12-20, i386-pc-mingw32 Cheers, Timo -- Timo Becker Phonetics Austrian Academy of Sciences Acoustics Research Institute
Timo Becker wrote:> Dear R users, > > When I run the following code, R crashes: > > require(cclust) > x <- matrix(c(0,0,0,1.5,1,-1), ncol=2, byrow=TRUE) > cclust(x, centers=x[2:3,], dist="manhattan", method="kmeans") > > While this works: > > cclust(x, centers=x[2:3,], dist="euclidean", method="kmeans") > > I'm posting this here because I am not sure if it is a bug. > I've been searching for a manhattan kmeans method and I found a solution > by using the package amap: > > require(amap) > Kmeans(x, x[2:3,], method="manhattan") > > This works for me, so I don't need the cclust package anymore. > Anyway, I wanted to report the cclust behaviour.Please report it to its mainatiner (CCing). Uwe Ligges> R version 2.2.1, 2005-12-20, i386-pc-mingw32 > > Cheers, > Timo >
Friedrich.Leisch at tuwien.ac.at
2006-Apr-07 07:33 UTC
[R] cclust causes R to crash when using manhattan kmeans
>>>>> On Fri, 07 Apr 2006 09:02:46 +0200, >>>>> Timo Becker (TB) wrote:> Dear R users, > When I run the following code, R crashes: > require(cclust) > x <- matrix(c(0,0,0,1.5,1,-1), ncol=2, byrow=TRUE) > cclust(x, centers=x[2:3,], dist="manhattan", method="kmeans") > While this works: > cclust(x, centers=x[2:3,], dist="euclidean", method="kmeans") > I'm posting this here because I am not sure if it is a bug. > I've been searching for a manhattan kmeans method and I found a solution > by using the package amap: > require(amap) > Kmeans(x, x[2:3,], method="manhattan") > This works for me, so I don't need the cclust package anymore. > Anyway, I wanted to report the cclust behaviour. > R version 2.2.1, 2005-12-20, i386-pc-mingw32 Thanks, this is indeed a bug, and has not been noticed yet because it seems to apply only for very small data sets like your example, for larger data sets it seems to works fine: R> require(cclust) Loading required package: cclust [1] TRUE R> x=matrix(rnorm(100), ncol=2) R> cclust(x, centers=x[2:3,], dist="manhattan", method="kmeans") Clustering on Training Set Number of Clusters: 2 Sizes of Clusters: 33 17 Algorithm converged after 4 iterations. Changes: 12 3 1 1 2 side notes: * cclust is no longer actively maintained, the code has been integrated in my more general package flexclust, see also http://www.ci.tuwien.ac.at/~leisch/papers/Leisch-2006.pdf (but cclust in flexclust has the same bug, so thanks a lot for reporting it). * r-help is not really the correct place to report bugs, please try to contact the package maintainer first, or use r-devel (but only if the maintainer does not respond to a direct email). This is not because we want to "hide bugs" from the public, but simply to reduce traffic on the lists. Best, Fritz -- ----------------------------------------------------------------------- Prof. Dr. Friedrich Leisch Institut f?r Statistik Tel: (+49 89) 2180 3165 Ludwig-Maximilians-Universit?t Fax: (+49 89) 2180 5308 Ludwigstra?e 33 D-80539 M?nchen http://www.ci.tuwien.ac.at/~leisch