From fd04df5f9d30fada094a89319fa70c948843c502 Mon Sep 17 00:00:00 2001 From: MS Berends <31037261+msberends@users.noreply.github.com> Date: Thu, 29 Mar 2018 13:23:02 +0200 Subject: [PATCH] Update clipboard.R --- R/clipboard.R | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/R/clipboard.R b/R/clipboard.R index 6630c07c..bf6d758f 100644 --- a/R/clipboard.R +++ b/R/clipboard.R @@ -27,7 +27,7 @@ clipboard_import <- function(sep = '\t', # use xclip package check_xclip() 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, @@ -82,8 +82,8 @@ clipboard_export <- function(x, } else { # use xclip package check_xclip() - file <- pipe("xclip -i -selection c", "w") - gc(FALSE) # ?gc: A call of gc causes a garbage collection to take place. + file <- pipe("xclip -i -selection primary", "w") + on.exit(close(file)) } write.table(x = x,