Wednesday, October 6, 2010

how to paste data into R

copy the data into the clipboard (Ctrl-C or Command-C)


in the R console run: mydata = read.table(file="clipboard")


For some versions of R, this does not work. Try


mydata = read.table(pipe("pbpaste"))



1 comment:

  1. Does that work for Ctrl+C Ctrl+V only or also for middle-click? In xsel I have access to a couple clipboards (primary, secondary, C-c C-v) and there are many others somewhere in my os.

    ReplyDelete

Subscribe via email

Enter your email address:

Delivered by FeedBurner

Followers

google analytics