Re: [R] Writing a data frame in an excel file

2009-11-18 Thread anna_l
Ok I´ve been trying to understand what is happening: the data.frame I am sending on the xls file has been constructed by the following way: I used the RODBC package to read dates and prices columns into a dataframe so the first column in excel is of type "date". In the data.frame it is not numeric

Re: [R] Writing a data frame in an excel file

2009-11-18 Thread Orvalho Augusto
Why don't try the fabulous WRITEXLS package? Caveman On Wed, Nov 18, 2009 at 7:45 PM, anna_l wrote: > > Thanks Karl, well I am getting an error now after the following sqlSave > command: > sqlSave( xlsFile, datas, tablename = 'Datas_and_coefficients', rownames = > FALSE ) > > -->  [RODBC] Faile

Re: [R] Writing a data frame in an excel file

2009-11-18 Thread anna_l
Thanks Karl, well I am getting an error now after the following sqlSave command: sqlSave( xlsFile, datas, tablename = 'Datas_and_coefficients', rownames = FALSE ) --> [RODBC] Failed exec in Update 22018 39 [Microsoft][Driver ODBC for Excel]invalid character value for the diffusion specification

Re: [R] Writing a data frame in an excel file

2009-11-18 Thread Karl Ove Hufthammer
On Wed, 18 Nov 2009 08:02:47 -0800 (PST) anna_l wrote: > Sorry Charlie, I didn?t understand that tablename=R Results was creating a > worksheet. But the thing now is that it works very well when I write for the > first time on the excel file but when I want to rewrite on it it gives the > error i

Re: [R] Writing a data frame in an excel file

2009-11-18 Thread anna_l
Sorry Charlie, I didn´t understand that tablename=R Results was creating a worksheet. But the thing now is that it works very well when I write for the first time on the excel file but when I want to rewrite on it it gives the error i wrote before saying that Results already exists, is there a way

Re: [R] Writing a data frame in an excel file

2009-11-18 Thread anna_l
Hi Charlie, I´ve been trying to use the sqlSave the way you showed me but it would give me this error message which I couldn´t solve: Erro em sqlSave(xlsFile, strategy, tablename = "Result", rownames = FALSE) : table ‘Result’ already exists I would like to save the data frame in a specified wo

Re: [R] Writing a data frame in an excel file

2009-11-16 Thread David Winsemius
On Nov 16, 2009, at 3:13 PM, David Winsemius wrote: On Nov 16, 2009, at 3:06 PM, smu wrote: hello, sep="\n" will seperate each column by \n which is not what you want. I think a csv would be the best solution. write.table(yourdataframe,sep=",") Excel will also read (and even prefers in

Re: [R] Writing a data frame in an excel file

2009-11-16 Thread Peter Ehlers
anna_l wrote: Hello, I am having trouble by using the write.table function to write a data frame of 4 columns and 7530 rows. I don´t know if I should just use a sep="\n" and change the .xls file into a .csv file. Thanks in advance - Anna Lippel new in R so be careful I should be asking a l

Re: [R] Writing a data frame in an excel file

2009-11-16 Thread David Winsemius
On Nov 16, 2009, at 3:06 PM, smu wrote: hello, sep="\n" will seperate each column by \n which is not what you want. I think a csv would be the best solution. write.table(yourdataframe,sep=",") Excel will also read (and even prefers in some sense) tab delimited files, so: write.table(yo

Re: [R] Writing a data frame in an excel file

2009-11-16 Thread smu
hello, sep="\n" will seperate each column by \n which is not what you want. I think a csv would be the best solution. write.table(yourdataframe,sep=",") or use write.csv directly. regards, stefan On Mon, Nov 16, 2009 at 11:49:28AM -0800, anna_l wrote: > > Hello, I am having trouble by using

Re: [R] Writing a data frame in an excel file

2009-11-16 Thread cls59
anna_l wrote: > > Hello, I am having trouble by using the write.table function to write a > data frame of 4 columns and 7530 rows. I don´t know if I should just use > a sep="\n" and change the .xls file into a .csv file. Thanks in advance > Base R cannot write .xls files by it's self. You s

[R] Writing a data frame in an excel file

2009-11-16 Thread anna_l
Hello, I am having trouble by using the write.table function to write a data frame of 4 columns and 7530 rows. I don´t know if I should just use a sep="\n" and change the .xls file into a .csv file. Thanks in advance - Anna Lippel new in R so be careful I should be asking a lt of que