On 13.12.2013 20:11, J Karon wrote:
I get an invalid connection method error message when trying to write an R object from a user-defined function to my hard drive (running Windows 7) using write.csv. I have previously not had this problem with the same user-defined function. The error message is Error in isOpen(file, "w") : invalid connection In addition: Warning message: In if (file == "") file <- stdout() else if (is.character(file)) { : the condition has length > 1 and only the first element will be used Using zz<-file(description="path","w") write.csv( ) close(zz) creates an empty file but yields the same error message when I execute write.csv.
Please tell us what you actually did. This works for me: zz <- file(description="path", "w") write.csv(iris, zz) close(zz) Best, Uwe Ligges ______________________________________________ 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.