Skip to content

Commit

Permalink
make functions and classes internal
Browse files Browse the repository at this point in the history
  • Loading branch information
JanMarvin committed Jul 10, 2023
1 parent 5e76ca1 commit fc16b0c
Show file tree
Hide file tree
Showing 20 changed files with 23 additions and 1,602 deletions.
9 changes: 0 additions & 9 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@ export(delete_data)
export(dims_to_dataframe)
export(dims_to_rowcol)
export(fmt_txt)
export(get_cell_refs)
export(get_date_origin)
export(guess_col_type)
export(int2col)
export(na_strings)
export(next_sheet)
Expand All @@ -45,11 +42,7 @@ export(style_mgr)
export(styles_on_sheet)
export(temp_xlsx)
export(wbChartSheet)
export(wbComment)
export(wbHyperlink)
export(wbSheetData)
export(wbWorkbook)
export(wbWorksheet)
export(wb_add_border)
export(wb_add_cell_style)
export(wb_add_chart_xml)
Expand Down Expand Up @@ -130,7 +123,6 @@ export(wb_set_selected)
export(wb_set_sheet_names)
export(wb_set_sheet_visibility)
export(wb_set_sheetview)
export(wb_sheet_data)
export(wb_to_df)
export(wb_ungroup_cols)
export(wb_ungroup_rows)
Expand All @@ -141,7 +133,6 @@ export(wb_ws)
export(write_comment)
export(write_data)
export(write_datatable)
export(write_file)
export(write_formula)
export(write_xlsx)
export(xl_open)
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
## Breaking changes

* Order of arguments in `wb_add_named_region()` changed, because previously overlooked `dims` argument was added.
* In various functions the order of `dims` was changed, to highlight it's importance

* Cleanups
* remove deprecated functions
Expand All @@ -18,6 +19,9 @@
* deprecating function
* `convertToExcelDate()` for `convert_to_excel_date()`

* 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

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


Expand Down
3 changes: 2 additions & 1 deletion R/class-comment.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
#'
#' A comment
#'
#' @export
#' @keywords internal
#' @noRd
wbComment <- R6::R6Class(
"wbComment",

Expand Down
3 changes: 2 additions & 1 deletion R/class-hyperlink.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
#'
#' A hyperlink
#'
#' @export
#' @keywords internal
#' @noRd
wbHyperlink <- R6::R6Class(
"wbHyperlink",

Expand Down
5 changes: 3 additions & 2 deletions R/class-sheet-data.R
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
#'
#' A hyperlink
#'
#' @export
#' @keywords internal
#' @noRd
wbSheetData <- R6::R6Class(
"wbSheetData",
public = list(
Expand All @@ -30,7 +31,7 @@ wbSheetData <- R6::R6Class(
## TODO is this even used?
#' @rdname wbSheetData
#' @keywords internal
#' @export
#' @noRd
wb_sheet_data <- function() {
wbSheetData$new()
}
Expand Down
3 changes: 2 additions & 1 deletion R/class-style_mgr.R
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,8 @@
#' wb$set_cell_style("SUM", "C7:C16", wb$styles_mgr$get_xf_id("new_xf"))
#' # wb_open(wb)
#'
#' @export
#' @keywords internal
#' @noRd
style_mgr <- R6::R6Class("wbStylesMgr", {

public <- list(
Expand Down
3 changes: 2 additions & 1 deletion R/class-worksheet.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,8 @@
#'
#' A Worksheet
#'
#' @export
#' @keywords internal
#' @noRd
wbWorksheet <- R6::R6Class(
"wbWorksheet",

Expand Down
3 changes: 2 additions & 1 deletion R/converters.R
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,8 @@ col2int <- function(x) {
#' # "B1"
#' get_cell_refs(data.frame(1:3, 2:4))
#' # "B1" "C2" "D3"
#' @export
#' @keywords internal
#' @noRd
get_cell_refs <- function(cellCoords) {
assert_class(cellCoords, "data.frame")
stopifnot(ncol(cellCoords) == 2L)
Expand Down
3 changes: 2 additions & 1 deletion R/dates.R
Original file line number Diff line number Diff line change
Expand Up @@ -106,7 +106,8 @@ convert_hms <- function(x) {
#'
#' get_date_origin(wb_workbook())
#' get_date_origin(wb_workbook(), origin = TRUE)
#' @export
#' @keywords internal
#' @noRd
get_date_origin <- function(xlsxFile, origin = FALSE) {

# TODO: allow using a workbook?
Expand Down
3 changes: 2 additions & 1 deletion R/pugixml.R
Original file line number Diff line number Diff line change
Expand Up @@ -265,7 +265,8 @@ as_xml <- function(x, ...) {
#' @param fl file name with full path
#' @param escapes bool if characters like "&" should be escaped. The default is
#' no escape, assuming that xml to export is already valid.
#' @export
#' @keywords internal
#' @noRd
# TODO needs a unit test
write_file <- function(head = "", body = "", tail = "", fl = "", escapes = FALSE) {
if (getOption("openxlsx2.force_utf8_encoding", default = FALSE)) {
Expand Down
3 changes: 2 additions & 1 deletion R/wb_functions.R
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,8 @@ dataframe_to_dims <- function(df) {
#' function to estimate the column type.
#' 0 = character, 1 = numeric, 2 = date.
#' @param tt dataframe produced by wb_to_df()
#' @export
#' @keywords internal
#' @noRd
guess_col_type <- function(tt) {

# all columns are character
Expand Down
23 changes: 0 additions & 23 deletions man/get_cell_refs.Rd

This file was deleted.

40 changes: 0 additions & 40 deletions man/get_date_origin.Rd

This file was deleted.

16 changes: 0 additions & 16 deletions man/guess_col_type.Rd

This file was deleted.

Loading

0 comments on commit fc16b0c

Please sign in to comment.