From f5209f5b3fee73c3b4b44842c2ebd927a01952ad Mon Sep 17 00:00:00 2001 From: olivroy <52606734+olivroy@users.noreply.github.com> Date: Thu, 24 Aug 2023 00:58:00 -0400 Subject: [PATCH] Remove wbChartSheet from exports (#760) * Redo pkgdown index. Remove docs for `wb_hyperlink()`. It was not exported anyway. * Oops * Tweak docs and add warnings about chartsheets to the description field. --- NAMESPACE | 1 - R/class-chart-sheet.R | 3 +- R/class-hyperlink.R | 2 +- R/class-workbook-wrappers.R | 18 ++-- R/dates.R | 7 +- _pkgdown.yml | 2 - man/Hyperlink.Rd | 11 --- man/convertToExcelDate.Rd | 14 +++ man/convert_to_excel_date.Rd | 3 - man/wbChartSheet.Rd | 172 ----------------------------------- man/wb_add_chartsheet.Rd | 19 ++-- man/wb_add_worksheet.Rd | 4 +- 12 files changed, 39 insertions(+), 217 deletions(-) delete mode 100644 man/Hyperlink.Rd create mode 100644 man/convertToExcelDate.Rd delete mode 100644 man/wbChartSheet.Rd diff --git a/NAMESPACE b/NAMESPACE index 27dc29fcf..7059951bc 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -39,7 +39,6 @@ export(remove_comment) export(rowcol_to_dims) export(styles_on_sheet) export(temp_xlsx) -export(wbChartSheet) export(wbWorkbook) export(wb_add_border) export(wb_add_cell_style) diff --git a/R/class-chart-sheet.R b/R/class-chart-sheet.R index f3340e2e0..13266a047 100644 --- a/R/class-chart-sheet.R +++ b/R/class-chart-sheet.R @@ -3,8 +3,7 @@ #' #' @description #' A chart sheet -#' -#' @export +#' @noRd wbChartSheet <- R6::R6Class( "wbChartSheet", diff --git a/R/class-hyperlink.R b/R/class-hyperlink.R index 4dcad875e..b75c6cf16 100644 --- a/R/class-hyperlink.R +++ b/R/class-hyperlink.R @@ -72,7 +72,7 @@ wbHyperlink <- R6::R6Class( ) #' Create a new hyperlink object -#' @rdname Hyperlink +#' @noRd wb_hyperlink <- function() { wbHyperlink$new(ref = character(), target = character(), location = character()) } diff --git a/R/class-workbook-wrappers.R b/R/class-workbook-wrappers.R index 0ce223aed..924cefa78 100644 --- a/R/class-workbook-wrappers.R +++ b/R/class-workbook-wrappers.R @@ -553,18 +553,14 @@ wb_unmerge_cells <- function(wb, sheet = current_sheet(), dims = NULL, ...) { #' Add a chartsheet to a workbook #' +#' A chartsheet is a special type of sheet that handles charts output. You must +#' add a chart to the sheet. Otherwise, this will break the workbook. +#' #' @param wb A Workbook object to attach the new chartsheet #' @param sheet A name for the new chartsheet -#' @param tab_color Color of the chartsheet tab. A valid color (belonging to -#' `colors()`) or a valid hex color beginning with "#" -#' @param zoom A numeric between 10 and 400. Worksheet zoom level as a -#' percentage. -#' @param visible If `FALSE`, sheet is hidden else visible. -#' @param ... ... -#' @details After chartsheet creation a chart must be added to the sheet. -#' Otherwise the chartsheet will break the workbook. +#' @inheritParams wb_add_worksheet #' @family workbook wrappers -#' @seealso [wb_add_mschart()] [wbChartSheet] +#' @seealso [wb_add_mschart()] #' @export wb_add_chartsheet <- function( wb, @@ -606,9 +602,9 @@ wb_add_chartsheet <- function( #' hidden. #' @param row_col_headers A logical. If `FALSE`, the worksheet colname and rowname will be #' hidden. -#' @param tab_color Color of the worksheet tab. A [wb_color()], a valid color (belonging to +#' @param tab_color Color of the sheet tab. A [wb_color()], a valid color (belonging to #' `grDevices::colors()`) or a valid hex color beginning with "#". -#' @param zoom The worksheet zoom level, a numeric between 10 and 400 as a +#' @param zoom The sheet zoom level, a numeric between 10 and 400 as a #' percentage. (A zoom value smaller than 10 will default to 10.) #' @param header,odd_header,even_header,first_header,footer,odd_footer,even_footer,first_footer #' Character vector of length 3 corresponding to positions left, center, diff --git a/R/dates.R b/R/dates.R index 3ae80db19..e068f8b9b 100644 --- a/R/dates.R +++ b/R/dates.R @@ -178,8 +178,13 @@ convert_to_excel_date <- function(df, date1904 = FALSE) { df } +#' Convert to Excel data +#' +#' Use [convert_to_excel_date()] in new code +#' @usage NULL +#' @inheritParams convert_to_excel_date +#' @keywords internal #' @export -#' @rdname convert_to_excel_date convertToExcelDate <- function(df, date1904 = FALSE) { .Deprecated(old = "convertToExcelDate", new = "convert_to_excel_date", package = "openxlsx2") convert_to_excel_date(df = df, date1904 = date1904) diff --git a/_pkgdown.yml b/_pkgdown.yml index fddfe7d59..eff6bc121 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -75,7 +75,6 @@ reference: These functions help you interact with chartsheets. They invisibly return the wbWorkbook object. They help interact with the mschart package. contents: - - wbChartSheet - wb_data - wb_add_chartsheet - wb_add_mschart @@ -93,7 +92,6 @@ reference: - wb_dims - wb_color - wb_comment - - wb_hyperlink - starts_with("create_") diff --git a/man/Hyperlink.Rd b/man/Hyperlink.Rd deleted file mode 100644 index e15783973..000000000 --- a/man/Hyperlink.Rd +++ /dev/null @@ -1,11 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/class-hyperlink.R -\name{wb_hyperlink} -\alias{wb_hyperlink} -\title{Create a new hyperlink object} -\usage{ -wb_hyperlink() -} -\description{ -Create a new hyperlink object -} diff --git a/man/convertToExcelDate.Rd b/man/convertToExcelDate.Rd new file mode 100644 index 000000000..395121548 --- /dev/null +++ b/man/convertToExcelDate.Rd @@ -0,0 +1,14 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/dates.R +\name{convertToExcelDate} +\alias{convertToExcelDate} +\title{Convert to Excel data} +\arguments{ +\item{df}{dataframe} + +\item{date1904}{take different origin} +} +\description{ +Use \code{\link[=convert_to_excel_date]{convert_to_excel_date()}} in new code +} +\keyword{internal} diff --git a/man/convert_to_excel_date.Rd b/man/convert_to_excel_date.Rd index ca4ac259f..0ae632961 100644 --- a/man/convert_to_excel_date.Rd +++ b/man/convert_to_excel_date.Rd @@ -2,12 +2,9 @@ % Please edit documentation in R/dates.R \name{convert_to_excel_date} \alias{convert_to_excel_date} -\alias{convertToExcelDate} \title{convert back to an Excel Date} \usage{ convert_to_excel_date(df, date1904 = FALSE) - -convertToExcelDate(df, date1904 = FALSE) } \arguments{ \item{df}{dataframe} diff --git a/man/wbChartSheet.Rd b/man/wbChartSheet.Rd deleted file mode 100644 index 1a83a825a..000000000 --- a/man/wbChartSheet.Rd +++ /dev/null @@ -1,172 +0,0 @@ -% Generated by roxygen2: do not edit by hand -% Please edit documentation in R/class-chart-sheet.R -\name{wbChartSheet} -\alias{wbChartSheet} -\title{R6 class for a Workbook Chart Sheet} -\value{ -A character vector of xml -} -\description{ -A chart sheet -} -\section{Public fields}{ -\if{html}{\out{
}} -\describe{ -\item{\code{sheetPr}}{Sheet something?} - -\item{\code{sheetViews}}{Something} - -\item{\code{sheetProtection}}{sheetProtection} - -\item{\code{customSheetViews}}{customSheetViews} - -\item{\code{pageMargins}}{page margins} - -\item{\code{pageSetup}}{pageSetup} - -\item{\code{headerFooter}}{headerFooter} - -\item{\code{drawing}}{drawing} - -\item{\code{drawingHF}}{drawingHF} - -\item{\code{picture}}{picture} - -\item{\code{webPublishItems}}{webPublishItems -#' @field hyperlinks hyperlinks -hyperlinks = NULL,} - -\item{\code{relships}}{relships} -} -\if{html}{\out{
}} -} -\section{Methods}{ -\subsection{Public methods}{ -\itemize{ -\item \href{#method-wbChartSheet-new}{\code{wbChartSheet$new()}} -\item \href{#method-wbChartSheet-get_prior_sheet_data}{\code{wbChartSheet$get_prior_sheet_data()}} -\item \href{#method-wbChartSheet-set_sheetview}{\code{wbChartSheet$set_sheetview()}} -\item \href{#method-wbChartSheet-clone}{\code{wbChartSheet$clone()}} -} -} -\if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-wbChartSheet-new}{}}} -\subsection{Method \code{new()}}{ -Create a new workbook chart sheet object -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{wbChartSheet$new(tab_color = NULL)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{tab_color}}{tabColor} -} -\if{html}{\out{
}} -} -\subsection{Returns}{ -The \code{wbChartSheet} object -} -} -\if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-wbChartSheet-get_prior_sheet_data}{}}} -\subsection{Method \code{get_prior_sheet_data()}}{ -get (prior) sheet data -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{wbChartSheet$get_prior_sheet_data()}\if{html}{\out{
}} -} - -} -\if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-wbChartSheet-set_sheetview}{}}} -\subsection{Method \code{set_sheetview()}}{ -add sheetview -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{wbChartSheet$set_sheetview( - color_id = NULL, - default_grid_color = NULL, - right_to_left = NULL, - show_formulas = NULL, - show_grid_lines = NULL, - show_outline_symbols = NULL, - show_row_col_headers = NULL, - show_ruler = NULL, - show_white_space = NULL, - show_zeros = NULL, - tab_selected = NULL, - top_left_cell = NULL, - view = NULL, - window_protection = NULL, - workbook_view_id = NULL, - zoom_scale = NULL, - zoom_scale_normal = NULL, - zoom_scale_page_layout_view = NULL, - zoom_scale_sheet_layout_view = NULL, - ... -)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{color_id, default_grid_color}}{Integer: A color, default is 64} - -\item{\code{right_to_left}}{Logical: if TRUE column ordering is right to left} - -\item{\code{show_formulas}}{Logical: if TRUE cell formulas are shown} - -\item{\code{show_grid_lines}}{Logical: if TRUE the worksheet grid is shown} - -\item{\code{show_outline_symbols}}{Logical: if TRUE outline symbols are shown} - -\item{\code{show_row_col_headers}}{Logical: if TRUE row and column headers are shown} - -\item{\code{show_ruler}}{Logical: if TRUE a ruler is shown in page layout view} - -\item{\code{show_white_space}}{Logical: if TRUE margins are shown in page layout view} - -\item{\code{show_zeros}}{Logical: if FALSE cells containing zero are shown blank if !showFormulas} - -\item{\code{tab_selected}}{Integer: zero vector indicating the selected tab} - -\item{\code{top_left_cell}}{Cell: the cell shown in the top left corner / or top right with rightToLeft} - -\item{\code{view}}{View: "normal", "pageBreakPreview" or "pageLayout"} - -\item{\code{window_protection}}{Logical: if TRUE the panes are protected} - -\item{\code{workbook_view_id}}{integer: Pointing to some other view inside the workbook} - -\item{\code{zoom_scale, zoom_scale_normal, zoom_scale_page_layout_view, zoom_scale_sheet_layout_view}}{Integer: the zoom scale should be between 10 and 400. These are values for current, normal etc.} - -\item{\code{...}}{additional arguments} - -\item{\code{sheet}}{sheet} -} -\if{html}{\out{
}} -} -\subsection{Returns}{ -The \code{wbWorksheetObject}, invisibly -} -} -\if{html}{\out{
}} -\if{html}{\out{}} -\if{latex}{\out{\hypertarget{method-wbChartSheet-clone}{}}} -\subsection{Method \code{clone()}}{ -The objects of this class are cloneable with this method. -\subsection{Usage}{ -\if{html}{\out{
}}\preformatted{wbChartSheet$clone(deep = FALSE)}\if{html}{\out{
}} -} - -\subsection{Arguments}{ -\if{html}{\out{
}} -\describe{ -\item{\code{deep}}{Whether to make a deep clone.} -} -\if{html}{\out{
}} -} -} -} diff --git a/man/wb_add_chartsheet.Rd b/man/wb_add_chartsheet.Rd index e5c823c4a..872ce20d6 100644 --- a/man/wb_add_chartsheet.Rd +++ b/man/wb_add_chartsheet.Rd @@ -18,25 +18,22 @@ wb_add_chartsheet( \item{sheet}{A name for the new chartsheet} -\item{tab_color}{Color of the chartsheet tab. A valid color (belonging to -\code{colors()}) or a valid hex color beginning with "#"} +\item{tab_color}{Color of the sheet tab. A \code{\link[=wb_color]{wb_color()}}, a valid color (belonging to +\code{grDevices::colors()}) or a valid hex color beginning with "#".} -\item{zoom}{A numeric between 10 and 400. Worksheet zoom level as a -percentage.} +\item{zoom}{The sheet zoom level, a numeric between 10 and 400 as a +percentage. (A zoom value smaller than 10 will default to 10.)} \item{visible}{If \code{FALSE}, sheet is hidden else visible.} -\item{...}{...} +\item{...}{Additional arguments} } \description{ -Add a chartsheet to a workbook -} -\details{ -After chartsheet creation a chart must be added to the sheet. -Otherwise the chartsheet will break the workbook. +A chartsheet is a special type of sheet that handles charts output. You must +add a chart to the sheet. Otherwise, this will break the workbook. } \seealso{ -\code{\link[=wb_add_mschart]{wb_add_mschart()}} \link{wbChartSheet} +\code{\link[=wb_add_mschart]{wb_add_mschart()}} Other workbook wrappers: \code{\link{wb_add_data_table}()}, diff --git a/man/wb_add_worksheet.Rd b/man/wb_add_worksheet.Rd index f8a048fb6..b52607aee 100644 --- a/man/wb_add_worksheet.Rd +++ b/man/wb_add_worksheet.Rd @@ -39,10 +39,10 @@ hidden.} \item{row_col_headers}{A logical. If \code{FALSE}, the worksheet colname and rowname will be hidden.} -\item{tab_color}{Color of the worksheet tab. A \code{\link[=wb_color]{wb_color()}}, a valid color (belonging to +\item{tab_color}{Color of the sheet tab. A \code{\link[=wb_color]{wb_color()}}, a valid color (belonging to \code{grDevices::colors()}) or a valid hex color beginning with "#".} -\item{zoom}{The worksheet zoom level, a numeric between 10 and 400 as a +\item{zoom}{The sheet zoom level, a numeric between 10 and 400 as a percentage. (A zoom value smaller than 10 will default to 10.)} \item{header, odd_header, even_header, first_header, footer, odd_footer, even_footer, first_footer}{Character vector of length 3 corresponding to positions left, center,