Quantcast

"easiest" way to write an R dataframe to excel?

classic Classic list List threaded Threaded
9 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

"easiest" way to write an R dataframe to excel?

Eva Nordstrom
I am using R 2.11.1 in a Microsoft Windows 7 environment.
 
I tried using WriteXLS, but get the message " In system(cmd) : perl not found"
 
What is the "easiest" way to write an R dataframe to Excel?  (I am familiar with
WriteXLS, but I do not have PERL installed, and if not needed, do not wish to
install it.)
 
I am also familiar with write.table, but if possible, wish to create an excel
file form within R.
 
I'm unsure if this is possible, or perhaps i should just go ahead and install
PERL...?


     
        [[alternative HTML version deleted]]


______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: "easiest" way to write an R dataframe to excel?

Liviu Andronic
On Mon, Aug 23, 2010 at 10:50 PM, Eva Nordstrom <[hidden email]> wrote:
> I am using R 2.11.1 in a Microsoft Windows 7 environment.
>
> I tried using WriteXLS, but get the message " In system(cmd) : perl not found"
>
> What is the "easiest" way to write an R dataframe to Excel?  (I am familiar with
> WriteXLS, but I do not have PERL installed, and if not needed, do not wish to
> install it.)
>
For easy ways, check RExcel and, perhaps, exporting a df to CSV via
Rcmdr menus (Data > Active data set > Export).
Liviu


> I am also familiar with write.table, but if possible, wish to create an excel
> file form within R.
>
> I'm unsure if this is possible, or perhaps i should just go ahead and install
> PERL...?
>
>
>
>        [[alternative HTML version deleted]]
>
>
> ______________________________________________
> [hidden email] 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.
>
>



--
Do you know how to read?
http://www.alienetworks.com/srtest.cfm
http://goodies.xfce.org/projects/applications/xfce4-dict#speed-reader
Do you know how to write?
http://garbl.home.comcast.net/~garbl/stylemanual/e.htm#e-mail

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: "easiest" way to write an R dataframe to excel?

Marc Schwartz-3
In reply to this post by Eva Nordstrom
On Aug 23, 2010, at 2:50 PM, Eva Nordstrom wrote:

> I am using R 2.11.1 in a Microsoft Windows 7 environment.
>  
> I tried using WriteXLS, but get the message " In system(cmd) : perl not found"
>  
> What is the "easiest" way to write an R dataframe to Excel?  (I am familiar with
> WriteXLS, but I do not have PERL installed, and if not needed, do not wish to
> install it.)
>  
> I am also familiar with write.table, but if possible, wish to create an excel
> file form within R.
>  
> I'm unsure if this is possible, or perhaps i should just go ahead and install
> PERL...?


There is a page in the R Wiki that provides an overview of your options:

  http://rwiki.sciviews.org/doku.php?id=tips:data-io:ms_windows


If you just need to do this once or just with a single data frame and writing the data frame to a CSV file and then opening the CSV file in Excel is satisfactory from a process/time standpoint, then using ?write.table might be the best approach.

On the other hand, if you are writing a number of data frames to a single Excel file and perhaps need to do this with some frequency, you will want to consider one of the other, more automated, approaches where you can create an Excel file directly from within R.

If you wish to use WriteXLS, there is an INSTALL file that you can review online (also in the package installation folder):

  http://cran.r-project.org/web/packages/WriteXLS/INSTALL

The easiest way to install Perl on Windows, that also has the Perl modules required for WriteXLS, is to use the ActiveState Perl distribution, available from:

  http://www.activestate.com/activeperl/

If you have problems or other questions with respect to WriteXLS, let me know.

HTH,

Marc Schwartz

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: "easiest" way to write an R dataframe to excel?

David Winsemius

On Aug 23, 2010, at 4:52 PM, Marc Schwartz wrote:

> On Aug 23, 2010, at 2:50 PM, Eva Nordstrom wrote:
>
>> I am using R 2.11.1 in a Microsoft Windows 7 environment.
>>
>> I tried using WriteXLS, but get the message " In system(cmd) : perl  
>> not found"
>>
> Snipped muc useful information

> If you have problems or other questions with respect to WriteXLS,  
> let me know.

Thanks for creating  WriteXLS, Marc. Others should know that WriteXLS  
has the great advantage over *.csv writing, in that it lets you make  
multi-sheet XLS files. Need a vector of 16 dataframes written to 16  
worksheets in one workbook ... no problem, ... worked the first time  
(at least it did so once I realized I needed to follow the directions  
in the help page exactly as they were written :-).

David Winsemius, MD
West Hartford, CT

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: "easiest" way to write an R dataframe to excel?

Marc Schwartz-3

On Aug 23, 2010, at 4:22 PM, David Winsemius wrote:

>
> On Aug 23, 2010, at 4:52 PM, Marc Schwartz wrote:
>
>> On Aug 23, 2010, at 2:50 PM, Eva Nordstrom wrote:
>>
>>> I am using R 2.11.1 in a Microsoft Windows 7 environment.
>>>
>>> I tried using WriteXLS, but get the message " In system(cmd) : perl not found"
>>>
>> Snipped muc useful information
>
>> If you have problems or other questions with respect to WriteXLS, let me know.
>
> Thanks for creating  WriteXLS, Marc. Others should know that WriteXLS has the great advantage over *.csv writing, in that it lets you make multi-sheet XLS files. Need a vector of 16 dataframes written to 16 worksheets in one workbook ... no problem, ... worked the first time (at least it did so once I realized I needed to follow the directions in the help page exactly as they were written :-).


Thanks for your kind words David. Much appreciated.

If you have suggestions on improving the INSTALL file or help page content, let me know.  :-)

Regards,

Marc

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: "easiest" way to write an R dataframe to excel?

Erik Iverson-3
In reply to this post by Eva Nordstrom
In addition to the Wiki already mentioned, the following may be
useful:

http://learnr.wordpress.com/2009/10/06/export-data-frames-to-multi-worksheet-excel-file/

Eva Nordstrom wrote:

> I am using R 2.11.1 in a Microsoft Windows 7 environment.
>  
> I tried using WriteXLS, but get the message " In system(cmd) : perl not found"
>  
> What is the "easiest" way to write an R dataframe to Excel?  (I am familiar with
> WriteXLS, but I do not have PERL installed, and if not needed, do not wish to
> install it.)
>  
> I am also familiar with write.table, but if possible, wish to create an excel
> file form within R.
>  
> I'm unsure if this is possible, or perhaps i should just go ahead and install
> PERL...?
>
>
>      
> [[alternative HTML version deleted]]
>
>
>
> ------------------------------------------------------------------------
>
> ______________________________________________
> [hidden email] 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.

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: "easiest" way to write an R dataframe to excel?

Erich Neuwirth
Search for an older message with the subject line

[R] export tables to excel files on multiple sheets with titles for each
table


On 8/23/2010 11:41 PM, Erik Iverson wrote:
> In addition to the Wiki already mentioned, the following may be
> useful:
>
> http://learnr.wordpress.com/2009/10/06/export-data-frames-to-multi-worksheet-excel-file/
>
>
> Eva Nordstrom wrote:

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Odp: "easiest" way to write an R dataframe to excel?

PIKAL Petr
In reply to this post by Eva Nordstrom
Hi

[hidden email] napsal dne 23.08.2010 21:50:01:

> I am using R 2.11.1 in a Microsoft Windows 7 environment.
>  
> I tried using WriteXLS, but get the message " In system(cmd) : perl not
found"
>  
> What is the "easiest" way to write an R dataframe to Excel?  (I am
familiar with
> WriteXLS, but I do not have PERL installed, and if not needed, do not
wish to
> install it.)
>  
> I am also familiar with write.table, but if possible, wish to create an
excel
> file form within R.

How big is your table

If it fit to clipboard you can

write.table(some.data.frame, "clipboard", sep="\t", row.names=FALSE)

and press CTRL-C in Excel

If not you can

write.table(some.data.frame, "mytable.xls", sep="\t", row.names=FALSE)

and the table is readable by Excel

Regards
Petr


>  
> I'm unsure if this is possible, or perhaps i should just go ahead and
install

> PERL...?
>
>
>
>    [[alternative HTML version deleted]]
>
> ______________________________________________
> [hidden email] 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.

______________________________________________
[hidden email] 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.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: "easiest" way to write an R dataframe to excel?

Ivan Calandra
In reply to this post by Erich Neuwirth
  Hi!

I personally use the function xlsReadWrite::write.xls(), which doesn't
need Perl to be installed. It might have less functionalities than
WriteXLS, but it is easier to use.

HTH,
Ivan

Le 8/24/2010 00:50, Erich Neuwirth a écrit :

> Search for an older message with the subject line
>
> [R] export tables to excel files on multiple sheets with titles for each
> table
>
>
> On 8/23/2010 11:41 PM, Erik Iverson wrote:
>> In addition to the Wiki already mentioned, the following may be
>> useful:
>>
>> http://learnr.wordpress.com/2009/10/06/export-data-frames-to-multi-worksheet-excel-file/
>>
>>
>> Eva Nordstrom wrote:
> ______________________________________________
> [hidden email] 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.
>
--
Ivan CALANDRA
PhD Student
University of Hamburg
Biozentrum Grindel und Zoologisches Museum
Abt. Säugetiere
Martin-Luther-King-Platz 3
D-20146 Hamburg, GERMANY
+49(0)40 42838 6231
[hidden email]

**********
http://www.for771.uni-bonn.de
http://webapp5.rrz.uni-hamburg.de/mammals/eng/mitarbeiter.php


        [[alternative HTML version deleted]]


______________________________________________
[hidden email] 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.
Loading...