[R] Function knn.dist from knnflex library

jmoreira at fe.up.pt jmoreira at fe.up.pt
Wed Apr 11 04:48:26 CEST 2007


Hello,

I am feeling that this question can have a very simple answer, but I  
can't find it.

I need to use the function knn.dist from knnflex library.

Whatever I try, I get the error:
Error in as.vector.dist(x, "character") : unused argument(s) ("character")

First example:

> a<-NULL
> a<-rbind(a,c(5.2,-8.1))
> a<-rbind(a,c(8.8,-16.1))
> a<-rbind(a,c(10.5,-0.9))
> knn.dist(a)
Error in as.vector.dist(x, "character") : unused argument(s) ("character")
>

Second example (taken from the examples section of knn.dist help page):

> x1 <- c(rnorm(20,mean=1),rnorm(20,mean=5))
> x2 <- c(rnorm(20,mean=5),rnorm(20,mean=1))
> x  <- cbind(x1,x2)
> kdist <- knn.dist(x)
Error in as.vector.dist(x, "character") : unused argument(s) ("character")
>

Am I doinhg something wrong? I can't understand. Any help is very much  
appreciated. Thanks in advance.

João Moreira



More information about the R-help mailing list