Copy an R data.frame to an Excel spreadsheet

后端 未结 3 1512
一个人的身影
一个人的身影 2021-02-02 08:39

I have a question which is exactly similar to this question.

As part of my work, I have to copy output from the R Studio Console to an excel worksheet in order to make e

3条回答
  •  天涯浪人
    2021-02-02 09:01

    From my experience there is no convenient way, I use two methods:

    For small data frames, use RStudio's View(data.frame) function, if you copy only data without headers it works fine, but if you want to copy with headers then you have to paste it into notepad first to add at least one character to the top left empty cell.

    For large data frames, use write.csv or write.xls (from package WriteXLS)

提交回复
热议问题