Dear all,

I am new to R. I am using the impute package with data contained in csv
file.
I have followed the example in the impute package as follows:

> mydata = read.csv("sample_impute.csv", header = TRUE)
> mydata.expr <- mydata[-1,-(1:2)]
> mydata.imputed <- impute.knn(as.matrix(mydata.expr))

The impute is succesful.

Then I try to write the imputation results (mydata.imputed) to a csv file
such as follows..

> write.csv(mydata.imputed, file = "sample_imputed.csv")
Error in data.frame(data = c(-0.07, -1.22, -0.09, -0.6, 0.65, -0.36, 0.25,
:
  arguments imply differing number of rows: 18, 1, 0

I need help understanding the error message and overcoming the
write.csvproblem. TQVM!

        [[alternative HTML version deleted]]

______________________________________________
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