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]]

