Import data into R from Mac OS X clipboard

Did you know that it is possible to import (read) data into R directly from Mac OS X clipboard? Actually it is easier than it looks like, provided that you know how to address the Mac clipboard within the read.table function.

The trick is to use pipe files. Pipe files in R can be addressed through the pipe function. Next you need to know the proper name of the pipe file that corresponds to the Mac clipboard, which is “pbpaste”.

Continue Reading