[R] append with write.table()

Ulrich Leopold uleopold at science.uva.nl
Mon Apr 29 13:59:03 CEST 2002


>>I get the following message while trying to append an object to a file.
>>
> 
> You are writing a data frame to a file. You have asked that the column
> names be written out.  That makes little sense in the middle of the file,
> so you get a warning.  Appending is (more-or-less) only useful to add rows
> to an existing data frame on a file.
> 
> 
>>In addition it is not appended. Do you know why?
>>
> 
> No, but then you haven't given us anything much to go on.
> Here's a working example:
> 
> 
>>library(MASS)
>>data(hills)
>>write.table(hills[1:20,], "hills.dat", quote=FALSE, sep="\t")
>>write.table(hills[22:25,], "hills.dat", quote=FALSE, sep="\t",
>>
>               append=TRUE, col.names=FALSE)
> 
> 
> 
>>write.table(PoxAv, "/home/uleopold/lsk_PoxAv", append=TRUE ,
>>quote=FALSE, sep="\t")
>>Warning message:
>>appending column names to file in: write.table(PoxAv,
>>"/home/uleopold/lsk_PoxAv", append = TRUE,
>>
>>Ulrich Leopold MSc.

 
Thanks Brian for pointing out.I think was wrong in what I wanted to do.

I wanted to append columns not rows. I thought it is possible with that command.

Is there a command which is similar to that but adding columns to a file or an object?

Ulrich


-- 
__________________________________________________

Ulrich Leopold MSc.

Department of Physical Geography
Institute for Biodiversity and Ecosystem Dynamics
Faculty of Science
University of Amsterdam
Nieuwe Achtergracht 166
NL-1018WV Amsterdam

Phone: +31-(0)20-525-7456 (7451 Secretary)
Fax:   +31-(0)20-525-7431
Email: uleopold at science.uva.nl
http://www.frw.uva.nl/soil/Welcome.html

Check us also out at:
Netherlands Centre for Geo-ecological Research
http://www.frw.uva.nl/icg



-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html
Send "info", "help", or "[un]subscribe"
(in the "body", not the subject !)  To: r-help-request at stat.math.ethz.ch
_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._



More information about the R-help mailing list