Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Package: readODS
Type: Package
Title: Read and Write ODS Files
Version: 2.3.2
Version: 2.3.3
Authors@R:
c(person("Gerrit-Jan", "Schutten", role = c("aut"), email = "[email protected]"),
person("Chung-hong", "Chan", role = c("aut", "cre"), email = "[email protected]", comment = c(ORCID = "0000-0002-6232-7530")),
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
# readODS 2.3.3

* Fix #213, prevent error when `set.seed` for `write_ods()`

# readODS 2.3.2

* Fix #207, trim off large or unused test files
Expand Down
2 changes: 1 addition & 1 deletion R/write_ods.R
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@
if (isFALSE(flat)) {
temp_ods_dir <- file.path(tempdir(), stringi::stri_rand_strings(1, 30, pattern = "[A-Za-z0-9]"))
dir.create(temp_ods_dir)
on.exit(unlink(temp_ods_dir))
on.exit(unlink(temp_ods_dir, recursive = TRUE))
}
if (append || update) {
.update_ods(x = .preprocess_x(x), path = path, sheet = sheet, append = append, update = update, row_names = row_names,
Expand Down
14 changes: 14 additions & 0 deletions tests/testthat/test_write_ods.R
Original file line number Diff line number Diff line change
Expand Up @@ -180,3 +180,17 @@ test_that("list of dataframes, edge cases #56", {
expect_error(path <- write_fods(list("iris" = iris), sheet = "whatever"), NA)
expect_equal(list_fods_sheets(path), c("iris")) ## sheet is ignored
})

withr::with_seed(123, {
test_that("fix 213 run 1", {
mydata <- data.frame(a=1:3, b=2:4)
expect_warning(write_ods(mydata), NA)
})
})

withr::with_seed(123, {
test_that("fix 213 run 2", {
mydata <- data.frame(a=1:3, b=2:4)
expect_warning(write_ods(mydata), NA)
})
})