[R] export table

Chuck Cleland ccleland at optonline.net
Wed Mar 21 19:19:30 CET 2007


Sergio Della Franca wrote:
> Dear R-Helpers,
> 
> I have a problem.
> 
> I want to export from R to .txt my data set(y):
> 
> YEARS PRODUCTS
> 1990     10
> 1995     15
> 1997     26
> 1998     29
> 2000     34
> 
> 
> I used this code:
> 
> write.table(y,"D:/Desktop/export_table.txt").
> 
> This procedure run correctly, but i acquired this result:
> 
>  YEARS PRODUCTS
> 1           1990     10
> 2           1995     15
> 3           1997     26
> 4           1998     29
> 5           2000     34
> 
> The prolem is that R add a column in the export procedure, but it doesn't
> give a name at column then this new column get the name of the first column
> of my data set.
> 
> There is a command that a must add to my export procedure to not export this
> column or to give at this a name?

write.table(y,"D:/Desktop/export_table.txt", row.names=FALSE)

  The row.names and col.names arguments are described in the help page
for write.table().

> Thank you in advance.
> 
> 
> Sergio.
> 
> 	[[alternative HTML version deleted]]
> 
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.

-- 
Chuck Cleland, Ph.D.
NDRI, Inc.
71 West 23rd Street, 8th floor
New York, NY 10010
tel: (212) 845-4495 (Tu, Th)
tel: (732) 512-0171 (M, W, F)
fax: (917) 438-0894



More information about the R-help mailing list