1
0
mirror of https://github.com/msberends/AMR.git synced 2024-12-26 16:46:13 +01:00

Update clipboard.R

This commit is contained in:
MS Berends 2018-03-29 13:23:02 +02:00 committed by GitHub
parent dbec56c68a
commit fd04df5f9d
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -27,7 +27,7 @@ clipboard_import <- function(sep = '\t',
# use xclip package # use xclip package
check_xclip() check_xclip()
file <- pipe("xclip -o -selection c", "r") file <- pipe("xclip -o -selection c", "r")
gc(FALSE) # ?gc: A call of gc causes a garbage collection to take place. on.exit(close(file))
} }
import_tbl <- read.delim(file = file, import_tbl <- read.delim(file = file,
@ -82,8 +82,8 @@ clipboard_export <- function(x,
} else { } else {
# use xclip package # use xclip package
check_xclip() check_xclip()
file <- pipe("xclip -i -selection c", "w") file <- pipe("xclip -i -selection primary", "w")
gc(FALSE) # ?gc: A call of gc causes a garbage collection to take place. on.exit(close(file))
} }
write.table(x = x, write.table(x = x,