clipboard error

This commit is contained in:
dr. M.S. (Matthijs) Berends 2018-08-01 10:32:24 +02:00
parent a59d0661f7
commit d8f70a74de
4 changed files with 9 additions and 7 deletions

View File

@ -71,7 +71,7 @@ clipboard_import <- function(sep = '\t',
date_format = '%Y-%m-%d', date_format = '%Y-%m-%d',
time_format = '%H:%M', time_format = '%H:%M',
remove_ASCII_escape_char = FALSE, remove_ASCII_escape_char = FALSE,
tz = Sys.timezone(), tz = "UTC",
encoding = "UTF-8", encoding = "UTF-8",
info = TRUE) { info = TRUE) {

View File

@ -117,7 +117,7 @@ tbl_parse_guess <- function(tbl,
date_format = '%Y-%m-%d', date_format = '%Y-%m-%d',
time_format = '%H:%M', time_format = '%H:%M',
decimal_mark = '.', decimal_mark = '.',
tz = Sys.timezone(), tz = "UTC",
encoding = "UTF-8", encoding = "UTF-8",
remove_ASCII_escape_char = FALSE, remove_ASCII_escape_char = FALSE,
na = c("", "NA", "NULL")) { na = c("", "NA", "NULL")) {

View File

@ -10,8 +10,8 @@ clipboard_import(sep = "\\t", quote = "", header = TRUE, dec = ".",
na = c("", "NA", "NULL"), stringsAsFactors = FALSE, startrow = 1, na = c("", "NA", "NULL"), stringsAsFactors = FALSE, startrow = 1,
as_vector = TRUE, guess_col_types = TRUE, date_names = "en", as_vector = TRUE, guess_col_types = TRUE, date_names = "en",
date_format = "\%Y-\%m-\%d", time_format = "\%H:\%M", date_format = "\%Y-\%m-\%d", time_format = "\%H:\%M",
remove_ASCII_escape_char = FALSE, tz = Sys.timezone(), remove_ASCII_escape_char = FALSE, tz = "UTC", encoding = "UTF-8",
encoding = "UTF-8", info = TRUE) info = TRUE)
clipboard_export(x, sep = "\\t", dec = ".", na = "", header = TRUE, clipboard_export(x, sep = "\\t", dec = ".", na = "", header = TRUE,
info = TRUE) info = TRUE)

View File

@ -10,12 +10,14 @@ test_that("clipboard works", {
skip_if_not(clipr::clipr_available()) skip_if_not(clipr::clipr_available())
clipboard_export(antibiotics) clipboard_export(antibiotics)
imp <- clipboard_import()
expect_identical(as.data.frame(antibiotics, stringsAsFactors = FALSE), expect_identical(as.data.frame(antibiotics, stringsAsFactors = FALSE),
clipboard_import()) imp)
clipboard_export(septic_patients[1:100,]) 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,]), expect_identical(as.data.frame(tbl_parse_guess(septic_patients[1:100,]),
stringsAsFactors = FALSE), stringsAsFactors = FALSE),
clipboard_import(guess_col_types = TRUE, imp)
stringsAsFactors = FALSE))
}) })