diff --git a/DESCRIPTION b/DESCRIPTION index 524b77f8e..75a25598e 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,7 +1,7 @@ Type: Package Package: openxlsx2 Title: Read, Write and Edit 'xlsx' Files -Version: 1.4.0.9000 +Version: 1.5 Language: en-US Authors@R: c( person("Jordan Mark", "Barbone", email = "jmbarbone@gmail.com", role = "aut", comment = c(ORCID = "0000-0001-9788-3628")), diff --git a/NEWS.md b/NEWS.md index 0403833d8..14f7b6b95 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# openxlsx2 (development version) +# openxlsx2 1.5 ## New features diff --git a/R/write.R b/R/write.R index a334519c9..a4dbc195e 100644 --- a/R/write.R +++ b/R/write.R @@ -827,7 +827,9 @@ write_data_table <- function( ### Create data frame -------------------------------------------------------- transpose <- FALSE - if (length(dims[[1]]) > length(dims[[2]])) + # do not transpose if input is a matrix. assuming that the input + if (length(dims[[1]]) > length(dims[[2]]) && + !inherits(x, "matrix") && !inherits(x, "data.frame")) transpose <- TRUE ## special case - formula diff --git a/revdep/README.md b/revdep/README.md index 7ff24a5a8..905fc602f 100644 --- a/revdep/README.md +++ b/revdep/README.md @@ -1,23 +1,23 @@ # Platform -|field |value | -|:--------|:----------------------------| -|version |R version 4.3.2 (2023-10-31) | -|os |Ubuntu 20.04.6 LTS | -|system |x86_64, linux-gnu | -|ui |X11 | -|language |(EN) | -|collate |C.UTF-8 | -|ctype |C.UTF-8 | -|tz |UTC | -|date |2024-02-15 | -|pandoc |2.19.2 @ /usr/bin/pandoc | +|field |value | +|:--------|:------------------------------------------------------| +|version |R version 4.3.3 (2024-02-29) | +|os |Ubuntu 20.04.6 LTS | +|system |x86_64, linux-gnu | +|ui |X11 | +|language |(EN) | +|collate |C.UTF-8 | +|ctype |C.UTF-8 | +|tz |UTC | +|date |2024-03-26 | +|pandoc |3.1.11 @ /opt/hostedtoolcache/pandoc/3.1.11/x64/pandoc | # Dependencies |package |old |new |Δ | |:---------|:------|:------|:--| -|openxlsx2 |1.3 |1.4 |* | +|openxlsx2 |1.4 |1.5 |* | |magrittr |2.0.3 |2.0.3 | | |R6 |2.5.1 |2.5.1 | | |Rcpp |1.0.12 |1.0.12 | | diff --git a/revdep/cran.md b/revdep/cran.md index cb582d739..5e0b18cb1 100644 --- a/revdep/cran.md +++ b/revdep/cran.md @@ -1,6 +1,6 @@ ## revdepcheck results -We checked 3 reverse dependencies (0 from CRAN + 3 from Bioconductor), comparing R CMD check results across CRAN and dev versions of this package. +We checked 4 reverse dependencies (0 from CRAN + 4 from Bioconductor), comparing R CMD check results across CRAN and dev versions of this package. * We saw 0 new problems * We failed to check 0 packages diff --git a/tests/testthat/test-write.R b/tests/testthat/test-write.R index ddf4b0be1..244cffbab 100644 --- a/tests/testthat/test-write.R +++ b/tests/testthat/test-write.R @@ -883,11 +883,11 @@ test_that("writing vectors direction with dims works", { # write vectors column or rowwise wb <- wb_workbook()$add_worksheet()$ add_data(x = 1:2, dims = "A1:B1")$ - add_data(x = t(1:2), dims = "D1:D2", col_names = FALSE)$ + add_data(x = t(1:2), dims = "D1:D2", col_names = FALSE)$ # ignores dims add_data(x = 1:2, dims = "A3:A4")$ - add_data(x = t(1:2), dims = "D3:E3", col_names = FALSE) + add_data(x = t(1:2), dims = "D3:E3", col_names = FALSE) # ignores dims - exp <- c("A1", "B1", "D1", "E1", "A3", "D3", "A4", "D4") + exp <- c("A1", "B1", "D1", "E1", "A3", "D3", "E3", "A4") got <- wb$worksheets[[1]]$sheet_data$cc$r expect_equal(exp, got)