[R] help with data import/export

Griffith Feeney gfeeney at hawaii.edu
Thu Aug 31 16:12:22 CEST 2000


Depends on the particulars of the data. Here's how I move between R and 
Excel for tables of the form

       col1  col2  ...  colm
row1     #     #  ...     #
row2     #     #  ...     #
.        .     .          .
.        .     .          .
.        .     .          .
rown     #     #  ...     #

where 'rowi' and 'colj' are labels (no spaces) and # numbers in body of table.

Excel -> R

Use 'save as space delimited text (.prn)' in Excel to create a text file 
name, say, 'table.txt', and 'data.matrix(read.table("table.txt")) in R to 
return as two dimensional array in R with row and column labels.

R -> Excel

Use sink("table"), where 'table' is the name of the R object, to print to a 
text file, then open the file in Excel and follow the import wizard steps.

At 10:42 PM 30/08/2000 -1000, you wrote:
>how can I import/export data from ms excel?
>also is there a way to import/export data of the hdf format?
>is there a way to import/export hdf format for ms excel as well?
>thank you very much in advance.
>/js
>######################################################################
>This e-mail message has been scanned and cleared by MailMarshal
>http://www.marshalsoftware.com
>######################################################################
>-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
>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
>_._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._ 
>

-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-
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