[R] simple question about exporting data...

Greg Snow Greg.Snow at imail.org
Thu Jul 23 15:59:55 CEST 2009


Doing the computations in R then the graphs in Excel reminds me of the maxim:

Measure with a micrometer
Mark with chalk
Cut with an ax

Before continuing you should really read: 
http://www.burns-stat.com/pages/Tutor/spreadsheet_addiction.html

and look at the final graphic in:
http://www.cs.uiowa.edu/~jcryer/JSMTalk2001.pdf

given that, I usually use predict like:

> newdata$pred <- predict(fit1, newdata)

Now the predicted values are a new column in the newdata data frame which can then be sent to excel (shudder) using write.table.  Or better, just use this data frame to do the plots in R.

You may also want to look at the Rexcel project that allows you to use R as a backend computation and graphics engine for an Excel front end.

-- 
Gregory (Greg) L. Snow Ph.D.
Statistical Data Center
Intermountain Healthcare
greg.snow at imail.org
801.408.8111


> -----Original Message-----
> From: r-help-bounces at r-project.org [mailto:r-help-bounces at r-
> project.org] On Behalf Of Rbeginner
> Sent: Thursday, July 23, 2009 12:51 AM
> To: r-help at r-project.org
> Subject: [R] simple question about exporting data...
> 
> 
> I just have a simple question. I'm using the predict function, and I
> get
> about 1000 values. Now, how would I make it into a data frame or a list
> so
> that I can easily use Excel to graph the data? Right now, it's in
> horizontal
> lines, and it would be a pain to copy and paste and make it into a
> vertical
> column.
> Thanks!
> --
> View this message in context: http://www.nabble.com/simple-question-
> about-exporting-data...-tp24620281p24620281.html
> Sent from the R help mailing list archive at Nabble.com.
> 
> ______________________________________________
> R-help at r-project.org 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.




More information about the R-help mailing list