[R] Copying tables from R to Excel

Duncan Murdoch murdoch.duncan at gmail.com
Tue Sep 23 16:10:55 CEST 2014


On 23/09/2014 9:04 AM, Angel Rodriguez wrote:
> Dear Subscribers,
>
> I've found this recommendation to paste an R table to Excel:
>
> HTML.matrix( summary(iris), file("clipboard", "w"), append=F )
>     # paste into Excel
>
> After installing R2HTML and writting that command, I get:
>
> Error: could not find function "HTML.matrix"
>
> Any clue?

HTML.matrix is the HTML method for matrix objects.  You just need to write

HTML( summary(iris), file("clipboard", "w"), append=F )

(I'd guess the information you were reading may have worked when it was 
written, but the R2HTML package stopped exporting the HTML.matrix 
function at some point.  Or maybe the author just never tried it.)

Duncan Murdoch



More information about the R-help mailing list