[R] Help with write.csv

From: Suhaila Zainudin <suhaila.zainudin_at_gmail.com>
Date: Mon, 11 Feb 2008 15:48:21 +0800


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_at_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. Received on Mon 11 Feb 2008 - 07:55:59 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Mon 11 Feb 2008 - 08:30:12 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive