Qiita Teams that are logged in
You are not logged in to any team

Log in to Qiita Team
Community
OrganizationEventAdvent CalendarQiitadon (β)
Service
Qiita JobsQiita ZineQiita Blog
2
Help us understand the problem. What is going on with this article?

More than 3 years have passed since last update.

@shibahead

Rのクリップボード出力時の容量最大値を上げる

RからExcelに手軽にデータをコピーしたい時、

write.table(sample_data, file = "clipboard", sep="\t")

が便利なわけですが、
コピーしたいデータのサイズが大きいと、以下のエラーが出ます。

clipboard buffer is full and output lost

対処として

write.table(sample_data, file = "clipboard-16384", sep="\t")

と書くと、16Mくらいまでであれば、コピー可能になります。(これ以上は無理のようです)

どういうことかと言いますと、
"clipboard-**" → **の部分で、クリップボードの容量最大値を指定できるようです。
詳しくは下記をご参照下さい。(というかこの記事は下記の和訳です。)
https://stackoverflow.com/questions/32035119/how-to-solve-clipboard-buffer-is-full-and-output-lost-error-in-r-running-in-wi

R上にも明記があって、
?connection でClipboardの項を見ると、
"When writing to the clipboard, the output is copied to the clipboard only when the connection is closed or flushed. There is a 32Kb limit on the text to be written to the clipboard. This can be raised by using e.g. file("clipboard-128") to give 128Kb."
とクリップボードの容量を変えられる記載があります。

よろしくお願いします。

2
Help us understand the problem. What is going on with this article?
Why not register and get more from Qiita?
  1. We will deliver articles that match you
    By following users and tags, you can catch up information on technical fields that you are interested in as a whole
  2. you can read useful information later efficiently
    By "stocking" the articles you like, you can search right away
2
Help us understand the problem. What is going on with this article?