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

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',
time_format = '%H:%M',
remove_ASCII_escape_char = FALSE,
tz = Sys.timezone(),
tz = "UTC",
encoding = "UTF-8",
info = TRUE) {

View File

@ -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")) {

View File

@ -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)

View File

@ -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)
})