Skip to content

Commit

Permalink
[write] disable hyperlink check for matrix otherwise vapply runs on e… (
Browse files Browse the repository at this point in the history
#876)

* [write] disable hyperlink check for matrix otherwise vapply runs on every cell instead of every column

* update NEWS
  • Loading branch information
JanMarvin authored Dec 27, 2023
1 parent 9ca9183 commit 4caa727
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 2 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,8 @@

* `wb_add_ignore_error()` now returns a `wbWorkbook`

* Deactivate the `is_hyperlink` check for non-dataframe objects in `wb_add_data()`. Internally, `vapply()` is applied to the input object, which is applied column-wise for a data frame and cell-wise for a matrix. This speeds up the writing of larger matrices considerably. [876](https://github.com/JanMarvin/openxlsx2/pull/876)


***************************************************************************

Expand Down
2 changes: 1 addition & 1 deletion R/write.R
Original file line number Diff line number Diff line change
Expand Up @@ -759,7 +759,7 @@ write_data_table <- function(
if (applyCellStyle) {
if (is.null(dim(x))) {
is_hyperlink <- inherits(x, "hyperlink")
} else {
} else if (is.data.frame(x)) { # dont check on a matrix
is_hyperlink <- vapply(x, inherits, what = "hyperlink", FALSE)
}

Expand Down

0 comments on commit 4caa727

Please sign in to comment.