ggrothendieck at myway.com
Wed Nov 5 20:39:00 CET 2003
I tried it using file and it seems to work for saving:
> con <- file("clipboard","w")
... lengthy output follows which seems correct ...
but not for loading:
> con <- file("clipboard","r")
Error in load(con) : loading from connections not compatible with magic number
even though when I try it with real files then it works both ways:
... iris is back ...
Date: Wed, 5 Nov 2003 19:01:20 +0000 (GMT)
From: Prof Brian Ripley <ripley at stats.ox.ac.uk>
To: Gabor Grothendieck <ggrothendieck at myway.com>
Cc: <R-help at stat.math.ethz.ch>
Subject: Re: [R] save(iris,file="clipboard",ascii=TRUE)
As should be evident , you thought wrong (and you are thinking in the
blinkered Windows way, too).
On Windows, file() can take a filename "clipboard" in text mode only.
load() and save() are not using file(), but you could probably use it
explicitly in ASCII mode.
Don't assume your own errors are bugs in other peoples' work: it is
On Wed, 5 Nov 2003, Gabor Grothendieck wrote:
> Is this a bug? I thought that "clipboard" could always be substituted
> for a filename when dealing with ASCII files.
> > data(iris)
> > save(iris,ascii=TRUE,file="clipboard")
> Error in file(file, "wb") : `mode' for the clipboard must be `r' or `w'
> Also this (where gclip is a utility found at unxutils.sourceforge.net
> that copies its standard input to the clipboard):
> > save(iris,ascii=TRUE,file="myiris.rda")
> > system("cmd /c gclip < myiris.rda")
> > load("clipboard")
> Error in open.connection(con, "rb") : unable to open connection
> In addition: Warning message:
> cannot open compressed file `clipboard'
No banners. No pop-ups. No kidding.
Introducing My Way - http://www.myway.com
More information about the R-help