From d8f70a74dead7fc6285f48f15ed07637cddb0dcb Mon Sep 17 00:00:00 2001 From: "Matthijs S. Berends" Date: Wed, 1 Aug 2018 10:32:24 +0200 Subject: [PATCH] clipboard error --- R/clipboard.R | 2 +- R/misc.R | 2 +- man/clipboard.Rd | 4 ++-- tests/testthat/test-clipboard.R | 8 +++++--- 4 files changed, 9 insertions(+), 7 deletions(-) diff --git a/R/clipboard.R b/R/clipboard.R index 8a33c98d..315ccbda 100644 --- a/R/clipboard.R +++ b/R/clipboard.R @@ -71,7 +71,7 @@ clipboard_import <- function(sep = '\t', date_format = '%Y-%m-%d', time_format = '%H:%M', remove_ASCII_escape_char = FALSE, - tz = Sys.timezone(), + tz = "UTC", encoding = "UTF-8", info = TRUE) { diff --git a/R/misc.R b/R/misc.R index 751cac1f..e8ff46a4 100755 --- a/R/misc.R +++ b/R/misc.R @@ -117,7 +117,7 @@ tbl_parse_guess <- function(tbl, date_format = '%Y-%m-%d', time_format = '%H:%M', decimal_mark = '.', - tz = Sys.timezone(), + tz = "UTC", encoding = "UTF-8", remove_ASCII_escape_char = FALSE, na = c("", "NA", "NULL")) { diff --git a/man/clipboard.Rd b/man/clipboard.Rd index 75cd0201..0cbdf030 100644 --- a/man/clipboard.Rd +++ b/man/clipboard.Rd @@ -10,8 +10,8 @@ clipboard_import(sep = "\\t", quote = "", header = TRUE, dec = ".", na = c("", "NA", "NULL"), stringsAsFactors = FALSE, startrow = 1, as_vector = TRUE, guess_col_types = TRUE, date_names = "en", date_format = "\%Y-\%m-\%d", time_format = "\%H:\%M", - remove_ASCII_escape_char = FALSE, tz = Sys.timezone(), - encoding = "UTF-8", info = TRUE) + remove_ASCII_escape_char = FALSE, tz = "UTC", encoding = "UTF-8", + info = TRUE) clipboard_export(x, sep = "\\t", dec = ".", na = "", header = TRUE, info = TRUE) diff --git a/tests/testthat/test-clipboard.R b/tests/testthat/test-clipboard.R index bb7c0a80..3b9eaabd 100644 --- a/tests/testthat/test-clipboard.R +++ b/tests/testthat/test-clipboard.R @@ -10,12 +10,14 @@ test_that("clipboard works", { skip_if_not(clipr::clipr_available()) clipboard_export(antibiotics) + imp <- clipboard_import() expect_identical(as.data.frame(antibiotics, stringsAsFactors = FALSE), - clipboard_import()) + imp) clipboard_export(septic_patients[1:100,]) + imp <- clipboard_import(guess_col_types = TRUE, + stringsAsFactors = FALSE) expect_identical(as.data.frame(tbl_parse_guess(septic_patients[1:100,]), stringsAsFactors = FALSE), - clipboard_import(guess_col_types = TRUE, - stringsAsFactors = FALSE)) + imp) })