read.clipboard.mac <- function(header=TRUE, ...) {
    read.table(pipe("pbpaste"), sep="\t", header=header, ...)
}
df <- read.clipboard.mac()
這樣在剪貼簿上面的資料就會存在df這個data frame裡面了~參考資料
- Copying Data from Excel to R and Back:上面的程式碼從這邊抓的
 - How to write from R to the clipboard on a mac:把R的資料存到剪貼簿上
 - Copying Data from Excel to R and Back:Windows上的解法
 
沒有留言:
張貼留言