[R] convert to csv file

Sarah Goslee sarah.goslee at gmail.com
Fri Sep 17 18:18:12 CEST 2010


More context would be useful, but my first guess is that you are
running into problems because both file and append are functions.
If you didn't explicitly set them to something else, R is using the
function.

What happens if you instead use:
filename <- "myfile.csv"
toappend <- FALSE
file(filename, ifelse(toappend, "a", "w"))

Sarah

On Fri, Sep 17, 2010 at 12:02 PM, lord12 <gaut222 at yahoo.com> wrote:
>
> I get an error message:
>
> Error in file(file, ifelse(append, "a", "w")) : invalid 'open' argument
>
> How do I resolve this?
> --


-- 
Sarah Goslee
http://www.functionaldiversity.org



More information about the R-help mailing list