[R] Importing data from clipboard on Mac OSX

From: Ken Knoblauch <kknoblauch_at_free.fr>
Date: Sun 27 Aug 2006 - 17:33:41 EST


Oops, forgot to include the Subject. sorry for that sloppiness.

Yes, you can, as documented in ?connections, but on the Mac you would have to use:

read.delim(pipe("pbpaste"))

You can also use pbcopy to copy to the clipboard.

> Dear R users,
>
> I am trying to get data from the clipboard into R on MacOSX. I tried
> the following, but got an error message:
>
> read.delim("clipboard")
> Error in file(file, "r") : unable to open connection
> In addition: Warning message:
> unable to contact X11 display
>
> Obviously, I'm not running R using X11. I'm wondering, can I import
> data from the clipboard on MacosX?
>
> Thanks in advance,
>
> Rense Nieuwenhuis
>
> > version
> _
> platform powerpc-apple-darwin8.6.0
> arch powerpc
> os darwin8.6.0
> system powerpc, darwin8.6.0
> status
> major 2
> minor 3.0
> year 2006
> month 04
> day 24
> svn rev 37909
> language R
> version.string Version 2.3.0 (2006-04-24)

        [[alternative text/enriched version deleted]]



R-help@stat.math.ethz.ch mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Sun Aug 27 17:38:37 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sun 27 Aug 2006 - 18:22:50 EST.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.