[R] Odp: simple question about exporting data...

Petr PIKAL petr.pikal at precheza.cz
Thu Jul 23 09:28:06 CEST 2009


Hi

Strange. Before starting with R about 10 years ago I used Excel for for 
graphing too. As soon as I learned few tricks and read intro documents I 
abandoned Excel for graphing almost completely. Now even for simple 
visualisations of data I copy them ***from*** spreadsheet to R. But as you 
make your bed you must lie in it.

Here is simple function to transfer data frame or vector by Ctrl-V 
approach
write.excel <- function (tab) write.table(tab, "clipboard", sep = "\t", 
row.names = F)

Issue
write.excel(1:10)
in R and in spreadsheet press Ctrl-V. Even with this simple vector you 
will get a column in Excel

But

fit <- lm(y~x, some data)
plot(some vector, predict(fit, newdata=some vector))
or even
plot(fit)

will give you far better results then Excel can do.

Regards
Petr


r-help-bounces at r-project.org napsal dne 23.07.2009 08:50:35:

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