Dear all,

This is my first time using this listserv and I am seeking help from the expert. OK, here is my question, I am trying to use impute.knn function in impute library and when I tested the sample code, I got the error as followingt:

Here is the sample code:
library(impute)
data(khanmiss)
khan.expr <- khanmiss[-1, -(1:2)]
## ## First example
## if(exists(".Random.seed")) rm(.Random.seed)
khan.imputed <- impute.knn(as.matrix(khan.expr))
## ## khan.imputed$data should now contain the imputed data matrix
x<-khan.imputed$data

Here are the results:

> library(impute)
> data(khanmiss)
> khan.expr <- khanmiss[-1, -(1:2)]
> ## ## First example
> ## if(exists(".Random.seed")) rm(.Random.seed)
> khan.imputed <- impute.knn(as.matrix(khan.expr))
Cluster size 2308 broken into 1448 860
Done cluster 1448
Done cluster 860
> ## ## khan.imputed$data should now contain the imputed data matrix
> x<-khan.imputed$data
Error in khan.imputed$data : $ operator is invalid for atomic vectors

It seems that khan.imputed$data is empty!! Why is that??

Any help is appreciated,

Jianying Li

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to