Re: [R] error in knn: too many ties in knn

2011-09-10 Thread Uwe Ligges
On 08.09.2011 14:19, Максим Иванов wrote: Hello. I found the behavior of knn( http://stat.ethz.ch/R-manual/R-devel/library/class/html/knn.html) function looking very strange. Consider the toy example. library(class) train<- matrix(nrow=5000,ncol=2,data=rnorm(1,0,1)) test<- matrix(nrow=10,nc

[R] error in knn: too many ties in knn

2011-09-08 Thread Максим Иванов
Hello. I found the behavior of knn( http://stat.ethz.ch/R-manual/R-devel/library/class/html/knn.html) function looking very strange. Consider the toy example. > library(class) > train <- matrix(nrow=5000,ncol=2,data=rnorm(1,0,1)) > test <- matrix(nrow=10,ncol=2,data=rnorm(20,0,1)) > cl <- rep(