[R] Maintaining Column names while writing csv file.

2012-07-19 Thread Vincy Pyne
Dear R helpers, I have one trivial problem while writing an output file in csv format. I have two dataframes say df1 and df2 which I am reading from two different csv files. df1 has column names as date, r1, r2, r3 while the dataframe df2 has column names as date, 1w, 2w. (the dates in

Re: [R] Maintaining Column names while writing csv file.

2012-07-19 Thread Eik Vettorazzi
Hi Vincy, have you checked names(df2) and names(df_new) because by default 'data.frame' checks the column names to ensure that they are syntactically valid variable names and 1w and 2w aren't, so an X is prepended (see ?data.frame and ?make.names). compare

Re: [R] Maintaining Column names while writing csv file.

2012-07-19 Thread Rolf Turner
On 19/07/12 18:55, Vincy Pyne wrote: Dear R helpers, I have one trivial problem while writing an output file in csv format. I have two dataframes say df1 and df2 which I am reading from two different csv files. df1 has column names as date, r1, r2, r3 while the dataframe df2 has column

Re: [R] Maintaining Column names while writing csv file.

2012-07-19 Thread arun
Message - From: Vincy Pyne vincy_p...@yahoo.ca To: r-help@r-project.org Cc: Sent: Thursday, July 19, 2012 2:55 AM Subject: [R] Maintaining Column names while writing csv file. Dear R helpers, I have one trivial problem while writing an output file in csv format. I have two dataframes say df1