Skip to content

Commit

Permalink
Merge branch 'main' into write-cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
olivroy committed Jul 13, 2023
2 parents b497755 + da82baa commit cb5d234
Show file tree
Hide file tree
Showing 55 changed files with 917 additions and 853 deletions.
4 changes: 1 addition & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ Description: Simplifies the creation of 'xlsx' files by
providing a high level interface to writing, styling and editing
worksheets.
License: MIT + file LICENSE
URL: https://github.com/JanMarvin/openxlsx2
URL: https://janmarvin.github.io/openxlsx2/, https://github.com/JanMarvin/openxlsx2
BugReports: https://github.com/JanMarvin/openxlsx2/issues
Depends:
R (>= 3.5.0)
Expand All @@ -28,12 +28,10 @@ Imports:
LinkingTo:
Rcpp
Suggests:
covr,
ggplot2,
knitr,
mschart (>= 0.4),
rmarkdown,
roxygen2,
rvg,
testthat (>= 3.0.0),
waldo
Expand Down
7 changes: 6 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# openxlsx2 (development version)

## New features

## API Change

* Function arguments are now defaulting to `snake_case`. For the time being, both arguments are accepted and `camelCase` will be switched to `snake_case` under the hood. Documentation like vignettes and examples are currently still displaying `camelCase` and maybe some `camelCase` function slipped through. [678](https://github.com/JanMarvin/openxlsx2/pull/678)

Expand All @@ -22,6 +23,10 @@
* make `get_cell_refs()`, `get_date_origin()`, `guess_col_type()`, and `write_file()` internal functions
* make classes `styles_mgr()`, `wbSheetData`, `wbWorksheet`, `wbChartsheet`, `wbComment`, `wbHyperlink` internal

## Refactoring

* Cleanup / revisit documentation and vignettes ([682](https://github.com/JanMarvin/openxlsx2/pull/682), @olivroy)

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


Expand Down
41 changes: 0 additions & 41 deletions R/all-equal.R

This file was deleted.

1 change: 0 additions & 1 deletion R/baseXML.R
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,6 @@ genClientData <- function(col, row, visible, height, width) {
#' @param range range (input cell range)
#' @param type type (Checkbox, Radio, Drop)
#' @param checked checked (bool)
#' @keywords internal
#' @noRd
genClientDataFC <- function(left, top, right, bottom, link, range, type, checked) {

Expand Down
3 changes: 1 addition & 2 deletions R/class-color.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@
#' @param theme A zero based index referencing a value in the theme.
#' @param tint A tint value applied. Range from -1 (dark) to 1 (light).
#' @return a `wbColour` object
#' @rdname wbColour
#' @export
wb_color <- function(
name = NULL,
Expand Down Expand Up @@ -38,7 +37,7 @@ wb_color <- function(
}

#' @export
#' @rdname wbColour
#' @rdname wb_color
#' @usage NULL
wb_colour <- wb_color

Expand Down
1 change: 0 additions & 1 deletion R/class-comment.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#'
#' A comment
#'
#' @keywords internal
#' @noRd
wbComment <- R6::R6Class(
"wbComment",
Expand Down
1 change: 0 additions & 1 deletion R/class-hyperlink.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#'
#' A hyperlink
#'
#' @keywords internal
#' @noRd
wbHyperlink <- R6::R6Class(
"wbHyperlink",
Expand Down
2 changes: 0 additions & 2 deletions R/class-sheet-data.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@
#'
#' A hyperlink
#'
#' @keywords internal
#' @noRd
wbSheetData <- R6::R6Class(
"wbSheetData",
Expand All @@ -30,7 +29,6 @@ wbSheetData <- R6::R6Class(

## TODO is this even used?
#' @rdname wbSheetData
#' @keywords internal
#' @noRd
wb_sheet_data <- function() {
wbSheetData$new()
Expand Down
1 change: 0 additions & 1 deletion R/class-style_mgr.R
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,6 @@
#' wb$set_cell_style("SUM", "C7:C16", wb$styles_mgr$get_xf_id("new_xf"))
#' # wb_open(wb)
#'
#' @keywords internal
#' @noRd
style_mgr <- R6::R6Class("wbStylesMgr", {

Expand Down
15 changes: 7 additions & 8 deletions R/class-workbook-wrappers.R
Original file line number Diff line number Diff line change
Expand Up @@ -312,14 +312,13 @@ wb_add_pivot_table <- function(
#'
#' @details Currently only the English version of functions are supported. Please don't use the local translation.
#' The examples below show a small list of possible formulas:
#' \itemize{
#' \item{SUM(B2:B4)}
#' \item{AVERAGE(B2:B4)}
#' \item{MIN(B2:B4)}
#' \item{MAX(B2:B4)}
#' \item{...}
#'
#' }
#' * SUM(B2:B4)
#' * AVERAGE(B2:B4)
#' * MIN(B2:B4)
#' * MAX(B2:B4)
#' * ...
#'
#' @param wb A Workbook object containing a worksheet.
#' @param sheet The worksheet to write to. Can be the worksheet index or name.
#' @param x A character vector.
Expand Down Expand Up @@ -880,7 +879,7 @@ wb_remove_row_heights <- function(wb, sheet = current_sheet(), rows) {
#' require(ggplot2)
#' p1 <- ggplot(mtcars, aes(x = mpg, fill = as.factor(gear))) +
#' ggtitle("Distribution of Gas Mileage") +
#' geom_density(alpha = I(.5))
#' geom_density(alpha = 0.5)
#' p2 <- ggplot(Orange, aes(x = age, y = circumference, color = Tree)) +
#' geom_point() + geom_line()
#'
Expand Down
2 changes: 1 addition & 1 deletion R/class-workbook.R
Original file line number Diff line number Diff line change
Expand Up @@ -6782,7 +6782,7 @@ wbWorkbook <- R6::R6Class(

sheet <- as.character(sheet)
if (has_illegal_chars(sheet)) {
stop("illegal characters found in sheet. Please remove. See ?openxlsx::clean_worksheet_name")
stop("illegal characters found in sheet. Please remove. See ?openxlsx2::clean_worksheet_name")
}

if (!nzchar(sheet)) {
Expand Down
1 change: 0 additions & 1 deletion R/class-worksheet.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
#'
#' A Worksheet
#'
#' @keywords internal
#' @noRd
wbWorksheet <- R6::R6Class(
"wbWorksheet",
Expand Down
19 changes: 1 addition & 18 deletions R/conditional_formatting.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@
#' @name cf_rules
#' @param formula formula
#' @param values values
#' @keywords internal
#' @noRd
cf_create_colorscale <- function(formula, values) {

Expand Down Expand Up @@ -84,11 +83,10 @@ cf_create_colorscale <- function(formula, values) {
}

#' @rdname cf_rules
#' @details `cf_create_databar()` returns extLst for worksheet
#' @param extLst extLst
#' @param params params
#' @param sqref sqref
#' @keywords internal
#' @details `cf_create_databar()` returns extLst for worksheet
#' @noRd
cf_create_databar <- function(extLst, formula, params, sqref, values) {
if (length(formula) == 2L) {
Expand Down Expand Up @@ -201,7 +199,6 @@ cf_create_databar <- function(extLst, formula, params, sqref, values) {
#' @rdname cf_rules
#' @param dxfId dxfId
#' @param formula formula
#' @keywords internal
#' @noRd
cf_create_expression <- function(dxfId, formula) {
cf_rule <- sprintf(
Expand All @@ -218,7 +215,6 @@ cf_create_expression <- function(dxfId, formula) {
}

#' @rdname cf_rules
#' @keywords internal
#' @noRd
cf_create_duplicated_values <- function(dxfId) {
cf_rule <- sprintf(
Expand All @@ -231,7 +227,6 @@ cf_create_duplicated_values <- function(dxfId) {
}

#' @rdname cf_rules
#' @keywords internal
#' @noRd
cf_create_contains_text <- function(dxfId, sqref, values) {
cf_rule <- sprintf(
Expand All @@ -250,7 +245,6 @@ cf_create_contains_text <- function(dxfId, sqref, values) {
}

#' @rdname cf_rules
#' @keywords internal
#' @noRd
cf_create_not_contains_text <- function(dxfId, sqref, values) {
cf_rule <- sprintf(
Expand All @@ -269,7 +263,6 @@ cf_create_not_contains_text <- function(dxfId, sqref, values) {
}

#' @rdname cf_rules
#' @keywords internal
#' @noRd
cf_begins_with <- function(dxfId, sqref, values) {
cf_rule <- sprintf(
Expand All @@ -289,7 +282,6 @@ cf_begins_with <- function(dxfId, sqref, values) {
}

#' @rdname cf_rules
#' @keywords internal
#' @noRd
cf_ends_with <- function(dxfId, sqref, values) {
cf_rule <- sprintf(
Expand All @@ -309,7 +301,6 @@ cf_ends_with <- function(dxfId, sqref, values) {
}

#' @rdname cf_rules
#' @keywords internal
#' @noRd
cf_between <- function(dxfId, formula) {
cf_rule <- sprintf(
Expand All @@ -328,7 +319,6 @@ cf_between <- function(dxfId, formula) {
}

#' @rdname cf_rules
#' @keywords internal
#' @noRd
cf_top_n <- function(dxfId, values) {
cf_rule <- sprintf(
Expand All @@ -343,7 +333,6 @@ cf_top_n <- function(dxfId, values) {
}

#' @rdname cf_rules
#' @keywords internal
#' @noRd
cf_bottom_n <- function(dxfId, values) {
cf_rule <- sprintf(
Expand All @@ -358,7 +347,6 @@ cf_bottom_n <- function(dxfId, values) {
}

#' @rdname cf_rules
#' @keywords internal
#' @noRd
cf_icon_set <- function(
values,
Expand Down Expand Up @@ -423,7 +411,6 @@ cf_icon_set <- function(
}

#' @rdname cf_rules
#' @keywords internal
#' @noRd
cf_unique_values <- function(dxfId) {
cf_rule <- sprintf(
Expand All @@ -435,7 +422,6 @@ cf_unique_values <- function(dxfId) {
}

#' @rdname cf_rules
#' @keywords internal
#' @noRd
cf_iserror <- function(dxfId, sqref) {
cf_rule <- sprintf(
Expand All @@ -452,7 +438,6 @@ cf_iserror <- function(dxfId, sqref) {
}

#' @rdname cf_rules
#' @keywords internal
#' @noRd
cf_isnoerror <- function(dxfId, sqref) {
cf_rule <- sprintf(
Expand All @@ -469,7 +454,6 @@ cf_isnoerror <- function(dxfId, sqref) {
}

#' @rdname cf_rules
#' @keywords internal
#' @noRd
cf_isblank <- function(dxfId, sqref) {
cf_rule <- sprintf(
Expand All @@ -486,7 +470,6 @@ cf_isblank <- function(dxfId, sqref) {
}

#' @rdname cf_rules
#' @keywords internal
#' @noRd
cf_isnoblank <- function(dxfId, sqref) {
cf_rule <- sprintf(
Expand Down
2 changes: 0 additions & 2 deletions R/converters.R
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ col2int <- function(x) {
#' # "B1"
#' get_cell_refs(data.frame(1:3, 2:4))
#' # "B1" "C2" "D3"
#' @keywords internal
#' @noRd
get_cell_refs <- function(cellCoords) {
assert_class(cellCoords, "data.frame")
Expand All @@ -79,7 +78,6 @@ get_cell_refs <- function(cellCoords) {
#'
#' @param base_font the base font name and fontsize
#' @param col_width column width
#' @keywords internal
#' @examples
#' base_font <- wb_get_base_font(wb)
#' calc_col_width(base_font, col_width = 10)
Expand Down
Loading

0 comments on commit cb5d234

Please sign in to comment.