[R] how to you output a vector to a column in excel?

Greg Snow Greg.Snow at imail.org
Wed Sep 8 18:51:24 CEST 2010


If you have Excel running with the sheet that you want to use open, then in R you can just do:

>  write.table( 1:10, 'clipboard', sep='\t', row.names=FALSE, col.names=FALSE )
>

(replace 1:10 with your vector)

Then go to excel, right click on the cell where you want the first number to be, and select paste.

-- 
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 lord12
> Sent: Tuesday, September 07, 2010 3:33 PM
> To: r-help at r-project.org
> Subject: [R] how to you output a vector to a column in excel?
> 
> 
> What is the syntax for this?
> 
> If you have: vector = c(1,2,3,4), how would you output this to column A
> of
> an excel spreadsheet?
> --
> View this message in context: http://r.789695.n4.nabble.com/how-to-you-
> output-a-vector-to-a-column-in-excel-tp2530470p2530470.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