Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update vignettes to snake_case, and other code quality updates #682

Merged
merged 47 commits into from Jul 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
47 commits
Select commit Hold shift + click to select a range
7210f28
Add myself in AUTHORS
olivroy Jul 3, 2023
256f9c7
Merged upstream/main into cleanup
olivroy Jul 10, 2023
5e50801
Move R/testthat-helpers.R to tests/testthat/helper.R
olivroy Jul 11, 2023
9200b6e
Add pkgdown link to DESCRIPTION and adjust openxlsx.Rproj
olivroy Jul 11, 2023
8157b9d
Tentative pkgdown function index (to avoid duplication)
olivroy Jul 11, 2023
c4a8ce9
Rename vignette so it appears as the Get Started vignette on the `_pk…
olivroy Jul 11, 2023
9b8f12a
Update dims and snake_case
olivroy Jul 11, 2023
98305c5
Update the intro vignette.
olivroy Jul 11, 2023
f24cb82
Rename packageDoc to `openxlsx2-package`, and add `@keywords internal`
olivroy Jul 11, 2023
4a3d426
Typo openxlsx -> openxlsx2
olivroy Jul 11, 2023
ef1714a
More markdown formatting
olivroy Jul 11, 2023
0a53ea5
Separate options in their own help file and add options to `reference…
olivroy Jul 11, 2023
3120d3d
Start working on conditional formatting
olivroy Jul 11, 2023
0fdce2b
Deleting `utils-pipe.R` since not reexporting the pipe.
olivroy Jul 11, 2023
e0de5c5
Move `expect_wrapper()` to tests/testthat/helper.R
olivroy Jul 11, 2023
4f8a65e
Revert pipe (since re-exporting after all)
olivroy Jul 11, 2023
118a8eb
Doc cleanup, add headers, remove useless Roxygen tags, add headers, s…
olivroy Jul 11, 2023
3594846
Add news bullet.
olivroy Jul 11, 2023
87939b6
Typo
olivroy Jul 11, 2023
7348294
Add keywords internal to the deprecated get_sheet_names(), so it does…
olivroy Jul 11, 2023
9e8bd55
Change order and tags on the R/dates.R so that exported functions are…
olivroy Jul 11, 2023
0d79772
Reorganize `dim_helpers` so the doc is more integrated.
olivroy Jul 11, 2023
c82287c
Reorder tags and redocument `read_xlsx` and `wb_read()`
olivroy Jul 11, 2023
988f1f7
Remove quotes on the `fmt_txt()` charset table and add indications on…
olivroy Jul 11, 2023
51dcf2a
Reorder tags and reorganize xl_open and write_xlsx
olivroy Jul 11, 2023
5de5758
Rm useless lines
olivroy Jul 11, 2023
bd170d1
Move `wbColour.Rd` to `wb_color.Rd`
olivroy Jul 11, 2023
1860eed
Fix name of wb_get_sheet_name
olivroy Jul 11, 2023
7f57fec
Put exported functions on top and helpers below in write.R
olivroy Jul 11, 2023
16ba234
Comment line in examples.
olivroy Jul 11, 2023
9294dac
Comment `fmt_txt()` parameter definition.
olivroy Jul 11, 2023
6fe20c0
Remove `@keywords internal` for un-exported functions.
olivroy Jul 11, 2023
c8c67f3
Code coverage is probably not done in `tests/testthat/`
olivroy Jul 11, 2023
a3939c1
Move `expect_equal_workbooks()` to `tests/testthat/helper.R`
olivroy Jul 11, 2023
445d6c9
Fix typos
olivroy Jul 11, 2023
d65c26d
Remove superflous deps from DESCRIPTION
olivroy Jul 11, 2023
80b445d
Add back waldo dep.
olivroy Jul 11, 2023
b0365a4
Final push
olivroy Jul 11, 2023
3151178
path correction
olivroy Jul 11, 2023
12a30a4
Revert bullet in README, and change in download.file
olivroy Jul 11, 2023
45eb52e
Revert changes to `R/write.R` and document()
olivroy Jul 11, 2023
644e136
Add full link to the PR in NEWS.md
olivroy Jul 12, 2023
7f4ea66
Re-render README.
olivroy Jul 12, 2023
4e9cf82
Move functions to Misc and Helpers (until a better index is found
olivroy Jul 12, 2023
8471e60
Put as 80 characters
olivroy Jul 12, 2023
d38adf7
Add comment about `fmt_txt` parameters
olivroy Jul 12, 2023
611d2db
formula correct
olivroy Jul 12, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 1 addition & 3 deletions DESCRIPTION
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,
JanMarvin marked this conversation as resolved.
Show resolved Hide resolved
ggplot2,
knitr,
mschart (>= 0.4),
rmarkdown,
roxygen2,
rvg,
testthat (>= 3.0.0),
waldo
Expand Down
7 changes: 6 additions & 1 deletion NEWS.md
@@ -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
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
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
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
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
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
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
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)
olivroy marked this conversation as resolved.
Show resolved Hide resolved
#' 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
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")
JanMarvin marked this conversation as resolved.
Show resolved Hide resolved
}

if (!nzchar(sheet)) {
Expand Down
1 change: 0 additions & 1 deletion R/class-worksheet.R
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
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
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