Home > OS >  I cannot paste Rstudio console output into Excel anymore
I cannot paste Rstudio console output into Excel anymore

Time:11-27

So previously, when I ran statistics in R, 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 paste it to notepad first and then copy and paste it to Excel.

What is the problem and how can I solve it?

enter image description here

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