write.table(x, file = "foo.csv", sep = ",", col.names = NA)
This should create a file "foo.csv" in the working directory. To find the working directory, use "getwd()"; to set it, use "setwd(...)". When you do this, can you find "foo.csv"?
2. I tried the command in your email:
>write.table(temp.data.data, file = "c:\Current Work")
I got a file "Current Work" (with no *.txt or other extension) in "C:\".
3. You need to be careful with "\" in text strings, because it is an R escape character. For example, the following modification of your example produced an error:
> write.table(temp.data.data, file = "c:\the Work")
Error in file(file, ifelse(append, "a", "w")) :
unable to open connection
In addition: Warning message:
cannot open file `c: he Work'This occurs because "\t" is a tab character.
4. If you wanted a file called, say, "temp.data.data.txt" in "c:\Current Work", you need something like the following:
write.table(temp.data.data, file = "c:\\Current Work\\temp.data.data.txt")
Since "\" is the escape character in R, to get "\" retained in the character string, you need to use "\\"; "/" is accepted as a substitute for "\\".
hope this helps.
spencer gravesChristina D Smith wrote:
>I'm not sure. The following code gives me no errors: >write.table(temp.data.data, file = "c:\Current Work") >Yet no new file is created. >Christy > >Quoting Spencer Graves <[EMAIL PROTECTED]>: >
###################
Did you try "write.table"? If yes, what do you see as its
deficiencies?spencer graves
Christina D Smith wrote:
I'm trying to export a large data frame to a text file for permanent storage. The only thing I could find was the treeglia Package but that didn't work. Any suggestions? Thanks!
Christina D Smith PhD Student, GRA Statistics Department Kansas State University
______________________________________________
[email protected] mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
______________________________________________ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
