Home > OS >  Excel wouldn't let me paste Rstudio console output
Excel wouldn't let me paste Rstudio console output

Time:11-26

So previously, when i run statistics in Rstudio, I was able to copy and paste to Excel works sheet (for example rstudio console window output), but now it seems like there is a problem. When i now press paste (or ctrl v), it just leaves it empty and nothing is pasted into the worksheet. It works if i past to notepad and then copy it from notepad and past to Excel.

What is the problem and how can i solve it?

Here you can see the problem from the print screen view

CodePudding user response:

It might depend on the object you are trying to paste. From my experience it works well with standard classes from R, e.g. copying the output of:

data.frame(A=c("cats","dogs","pig"), B=c("kittens","puppies","pig"))

from the console to Excel works fine.

However, if I convert to something from the tidyverse, e.g.

tibble(A=c("cats","dogs","pig"), B=c("kittens","puppies","pig"))

it doesn't copy nicely anymore. One solution is to not directly paste into Excel, but use the "paste" button, then "paste special", then choose "unicode text".

Some reference here: https://support.microsoft.com/en-us/office/paste-special-e03db6c7-8295-4529-957d-16ac8a778719

CodePudding user response:

Have you tried other paste options in Excel?

When you right-click where you want to paste, below "Paste" there should be a "Paste Special" option with an arrow that displays all the pasting options. Maybe some of those solve your problem?

  • Related