Skip to content

a clipboard problem while using R2HTML

2 messages · Frank Liu, Brian Ripley

#
I followed the examples of previous posts about R2HTML to practice 
exporting a data to a clipboard, but the result is not as smooth as I 
had expected:

library(R2HTML)
data(iris)
HTML(iris, file("clipboard","w"), append=FALSE)

I got an error message:
 > HTML(iris, file("clipboard","w"), append=FALSE)
Error in file("clipboard", "w") : 'mode' for the clipboard must be 'r' 
on Unix

I changed w to r, but there seems a clipboard problem:
 > HTML(iris, file("clipboard","r"), append=FALSE)
Error: clipboard connection is open for reading only

The only setting about the clipboard is in my .emacs is:
  '(x-select-enable-clipboard t))

Thank you in advance for any hint.
I am using Linux Fedora 4. Kernel 2.6.15-1.1833_1.
R version 2.3.0, ESS 5.3.0.

-Frank
#
See ?file, which says

      'file' can also be used with 'description = "clipboard"' in mode
      '"r"' only. ...

on Unix-alikes.  (This is different on Windows, where the clipboard is an 
OS service, not part of the X11 addon.)
On Thu, 4 May 2006, Frank Liu wrote:

            
You don't give any references here: they were probably refering to 
Windows.
The `problem' is your not reading the documentation.