Re: [R] Simple question about export
On Wed, 12 Mar 2003, Michael Miettinen wrote: Sorry about making this stupid question, but I did not find the answer from documentation. See the FAQ question 7.10 How do file names work in Windows? I managed to read my spss .sav file into the R, no problem. Next I would like to write this data to a file in ascii-format. I tried to use write.table and I got no error messages, but no file either. What is the right way to make it? At least write.table(c:\foo\data.dat) does not work.. -- Brian D. Ripley, [EMAIL PROTECTED] Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UKFax: +44 1865 272595 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
RE: [R] Simple question about export
Well, you did not specify the object to save in write.table(). Suppose you want to save the following: x - matrix( c(1:25), nrow=5) write.table(x, file=c:/my.output.file.txt) If all goes well, you should see the prompt without any message. Also use / rather than \ as it is reserved for escape sequences. You might also consider setting the option sep=\t and quote=FALSE to make it truly tab-delimited file. There is also row.names, col.name option. Try reading the R Data Import/Export or write.table() again. -Original Message- From: Michael Miettinen [mailto:[EMAIL PROTECTED] Sent: Wednesday, March 12, 2003 9:13 PM To: [EMAIL PROTECTED] Subject: [R] Simple question about export Hi, Sorry about making this stupid question, but I did not find the answer from documentation. I managed to read my spss .sav file into the R, no problem. Next I would like to write this data to a file in ascii-format. I tried to use write.table and I got no error messages, but no file either. What is the right way to make it? At least write.table(c:\foo\data.dat) does not work.. Thanks in advance! Michael = [EMAIL PROTECTED] +358 40 849 1140 __ Yahoo! Web Hosting - establish your business online __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
RE: [R] Simple question about export
If that is what you tried, then you didn't supply the object to the write.table function. e.g. if your data.frame is called mydata in R you need write.table(mydata,c:/foo/data.dat) The file is ascii. Note also that you either have to use forward slashes (as above) or double backslashes write.table(mydata,c:\\foo\\data.dat) R doesn't do the expected thing with single backslashes as you wrote it. -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] Behalf Of Michael Miettinen Sent: 12 March 2003 15:13 To: [EMAIL PROTECTED] Subject: [R] Simple question about export Hi, Sorry about making this stupid question, but I did not find the answer from documentation. I managed to read my spss .sav file into the R, no problem. Next I would like to write this data to a file in ascii-format. I tried to use write.table and I got no error messages, but no file either. What is the right way to make it? At least write.table(c:\foo\data.dat) does not work.. Thanks in advance! Michael = [EMAIL PROTECTED] +358 40 849 1140 __ Yahoo! Web Hosting - establish your business online __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help
Re: [R] Simple question about export
- Original Message - From: Michael Miettinen [EMAIL PROTECTED] To: [EMAIL PROTECTED] Sent: Wednesday, 12 March, 2003 2:13 PM Subject: [R] Simple question about export Hi, Sorry about making this stupid question, but I did not find the answer from documentation. I managed to read my spss .sav file into the R, no problem. Next I would like to write this data to a file in ascii-format. I tried to use write.table and I got no error messages, but no file either. What is the right way to make it? At least write.table(c:\foo\data.dat) does not From the rw-FAQ: Backslashes have to be doubled in R character strings: write.table(x, c:\\foo\\data.dat) or use a forward slash: write.table(x, c:/foo/data.dat) where x is your data object Mathieu Roelants, Project Vlaamse Groeicurven[EMAIL PROTECTED] Laboratorium Antropogenetica Vrije Universiteit Brussel, Pleinlaan 2, B-1050 Brussel Tel.+Fax 02/629.34.07 Laboratory of Anthropogenetics - University of Brussels, Pleinlaan 2, B-1050 Brussels (Belgium) Tel.+Fax + 32 2 629 34 07 __ [EMAIL PROTECTED] mailing list https://www.stat.math.ethz.ch/mailman/listinfo/r-help