Skip to content

Commit

Permalink
Release 1.8 (#1069)
Browse files Browse the repository at this point in the history
* [dims] further cleanup and update roxygen

* [news] en_CA -> en_US and updates for 1.8

* bump version
  • Loading branch information
JanMarvin authored Jul 7, 2024
1 parent e639220 commit fa80047
Show file tree
Hide file tree
Showing 5 changed files with 47 additions and 17 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
Type: Package
Package: openxlsx2
Title: Read, Write and Edit 'xlsx' Files
Version: 1.7.0.9000
Version: 1.8
Language: en-US
Authors@R: c(
person("Jordan Mark", "Barbone", email = "jmbarbone@gmail.com", role = "aut", comment = c(ORCID = "0000-0001-9788-3628")),
Expand Down Expand Up @@ -39,7 +39,7 @@ Suggests:
VignetteBuilder:
knitr
Encoding: UTF-8
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
Roxygen: list(markdown = TRUE)
Config/testthat/edition: 3
Config/testthat/parallel: true
27 changes: 24 additions & 3 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,29 @@
# openxlsx2 (development version)
# openxlsx2 1.8

* Legacy `write_data()`, `write_datatable()`, `write_formula()`, `write_comment()` are now deprecated in favour of `wb_add_data()`, `wb_add_data_table()`, `wb_add_formula()`, and `wb_add_comment()`.
## Maintenance

* Legacy `write_data()`, `write_datatable()`, `write_formula()`, `write_comment()` are now deprecated in favor of `wb_add_data()`, `wb_add_data_table()`, `wb_add_formula()`, and `wb_add_comment()`. ([1064](https://github.com/JanMarvin/openxlsx2/pull/1064), @olivroy).

* `convertToExcelDate()` is defunct and will be removed in a future version of the package. Use `convert_to_excel_date()`. ([1064](https://github.com/JanMarvin/openxlsx2/pull/1064), @olivroy).

## New features

* `wb_dims()` is now able to handle various columns. [1019](https://github.com/JanMarvin/openxlsx2/pull/1019)

* `wb_to_df()` now has a `check_names` argument. [1050](https://github.com/JanMarvin/openxlsx2/pull/1050)

* The set of conditional formatting icon sets now includes x14 icons. This commit also fixed adding conditional formatting to worksheets with pivot tables. [1053](https://github.com/JanMarvin/openxlsx2/pull/1053)

## Fixes

* Many improvements in the `xlsb` parser. This includes changes to the logic of the formula parser, rich text strings are now handled, data validation, table formulas and various corrections all over the place. It is still lacking various features and this wont change in the foreseeable future, but the parser is now in better shape than ever. [1037](https://github.com/JanMarvin/openxlsx2/pull/1037), [1040](https://github.com/JanMarvin/openxlsx2/pull/1040), [1042](https://github.com/JanMarvin/openxlsx2/pull/1042), [1044](https://github.com/JanMarvin/openxlsx2/pull/1044), [1049](https://github.com/JanMarvin/openxlsx2/pull/1049), [1054](https://github.com/JanMarvin/openxlsx2/pull/1054)

* `write_xlsx()` now uses `sheet`. Previously it required the undocumented `sheet_name`. [1057](https://github.com/JanMarvin/openxlsx2/pull/1057)

* Fixed a bug were we obfuscated valid html in worksheets with vml buttons. These files previously did not load. [1062](https://github.com/JanMarvin/openxlsx2/pull/1062)

* Fixed slow writing of non consecutive number formats introduced in the previous release. [1067](https://github.com/JanMarvin/openxlsx2/pull/1067), [1068](https://github.com/JanMarvin/openxlsx2/pull/1068)

* `convertToExcelDate()` is defunct and will be removed in a future version of the package. Use `convert_to_excel_date()`.

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

Expand Down
24 changes: 16 additions & 8 deletions R/utils.R
Original file line number Diff line number Diff line change
Expand Up @@ -1238,17 +1238,25 @@ is_dims <- function(x) {
}

#' check if non consecutive dims is equal sized: "A1:A4,B1:B4"
get_dims <- function(dims, check = TRUE, cols = TRUE) {
#' @param dims dims
#' @param check check if all the same size
#' @param cols return columns index
#' @keywords internal
#' @noRd
get_dims <- function(dims, check = FALSE, cols = FALSE, rows = FALSE) {

rows <- unique(
lapply(dims, FUN = function(dim) {
dimensions <- strsplit(dim, ":")[[1]]
as.integer(gsub("[[:upper:]]", "", dimensions))
})
)
if (check || rows) {
rows <- unique(
lapply(dims, FUN = function(dim) {
dimensions <- strsplit(dim, ":")[[1]]
as.integer(gsub("[[:upper:]]", "", dimensions))
})
)
}

if (check)
if (check) {
return(length(rows) == 1)
}

if (cols) {
cols <- unique(
Expand Down
6 changes: 3 additions & 3 deletions R/wb_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ dims_to_dataframe <- function(dims, fill = FALSE, empty_rm = FALSE) {
# condition 1) contains dims separator, but all dims are of
# equal size: "A1:A5,B1:B5"
# condition 2) either "A1:B5" or separator, but unequal size or "A1:A2,A4:A6,B1:B5"
if (has_dim_sep && get_dims(dims)) {
if (has_dim_sep && get_dims(dims, check = TRUE)) {

full_rows <- get_dims(dims, check = FALSE, cols = FALSE)
full_cols <- sort(get_dims(dims, check = FALSE, cols = TRUE))
full_rows <- get_dims(dims, rows = TRUE)
full_cols <- sort(get_dims(dims, cols = TRUE))

rows_out <- unlist(full_rows)
cols_out <- int2col(full_cols)
Expand Down
3 changes: 2 additions & 1 deletion man/convert_date.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit fa80047

Please sign in to comment.