Message-ID: <52AC8FEA.2090905@statistik.tu-dortmund.de>
Date: 2013-12-14T17:05:46Z
From: Uwe Ligges
Subject: Invalid connection error message when trying to write a file
In-Reply-To: <1386961869720-4682149.post@n4.nabble.com>
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