Skip to content

Commit 7f34364

Browse files
committed
[doc] remove examples for unexported functions and exclude examples. They are messy anyways and are in need of some additional cleanups. Avoid \dontrun{}, this actually fixed a typo in the example
1 parent 16fc6ee commit 7f34364

15 files changed

Lines changed: 17 additions & 79 deletions

.Rbuildignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ codecov.yml
1818
# Temporary files
1919
.DS_Store
2020
\~\$.*\.[a-z]+$
21+
^inst/examples$
2122
^inst/img/highres$
2223
vignettes/img/worksheet_styling.jpg
2324

DESCRIPTION

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ Package: encharter
22
Type: Package
33
Title: Enhanced Office Open XML Charting for 'openxlsx2'
44
Version: 0.9
5+
Language: en-US
56
Authors@R: c(
67
person("Jan Marvin", "Garbuszus", email = "jan.garbuszus@ruhr-uni-bochum.de", role = c("aut", "cre"))
78
)

R/encharter_chart.R

Lines changed: 5 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,11 +85,9 @@ Chart <- R6::R6Class(
8585
#' @param line Six-digit hex color for the title border.
8686
#' @param line_width Numeric border width in points.
8787
#' @examples
88-
#' \dontrun{
89-
#' ec("scatter") |>
90-
#' add_series(data = "Sheet1!A1:A10", secondary = "x") |>
88+
#' ec("scatter")$
89+
#' add_series(data = "Sheet1!A1:A10", secondary = "x")$
9190
#' set_x2_title("Secondary X", font_color = "888888")
92-
#' }
9391
set_x2_title = function(text, font_size = NULL, font_name = NULL, font_color = NULL,
9492
bold = NULL, italic = NULL, fill = NULL, line = NULL,
9593
line_width = NULL) {
@@ -119,12 +117,10 @@ Chart <- R6::R6Class(
119117
#' @param line Six-digit hex color for the title border.
120118
#' @param line_width Numeric border width in points.
121119
#' @examples
122-
#' \dontrun{
123-
#' ec("line") |>
124-
#' add_series(data = "Sheet1!A1:A10") |>
125-
#' add_series(data = "Sheet1!B1:B10", secondary = TRUE) |>
120+
#' ec("line")$
121+
#' add_series(data = "Sheet1!A1:A10")$
122+
#' add_series(data = "Sheet1!B1:B10", secondary = TRUE)$
126123
#' set_y2_title("Growth Rate (%)")
127-
#' }
128124
set_y2_title = function(text, font_size = NULL, font_name = NULL, font_color = NULL,
129125
bold = NULL, italic = NULL, fill = NULL, line = NULL,
130126
line_width = NULL) {

R/pugixml.R

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,6 @@
77
#' @param .value Optional character string to set as text content.
88
#' @return The newly created pugi_node.
99
#' @keywords internal
10-
#' @examples
11-
#' # doc <- read_xml("<root><child/></root>")
12-
#' # xml_add_child(doc, "new_node", id = "1", "Some text")
1310
xml_add_child <- function(.x, .name, ..., .where = -1, .value = NULL) {
1411
target <- if (is.list(.x)) .x[[1]] else .x
1512

@@ -45,8 +42,6 @@ xml_add_child <- function(.x, .name, ..., .where = -1, .value = NULL) {
4542
#' @param xpath Character string containing XPath expression.
4643
#' @return A pugi_node or list of nodes.
4744
#' @keywords internal
48-
#' @examples
49-
#' # xml_find_first(doc, ".//sheetData")
5045
xml_find_first <- function(x, xpath) {
5146
if (is.list(x)) return(lapply(x, xml_find_first, xpath = xpath))
5247
if (!grepl("^\\.|^/", xpath)) xpath <- paste0(".//", xpath)
@@ -59,8 +54,6 @@ xml_find_first <- function(x, xpath) {
5954
#' @param xpath Character string containing XPath expression.
6055
#' @return A pugi_nodeset (list of pugi_nodes).
6156
#' @keywords internal
62-
#' @examples
63-
#' # xml_find_all(doc, ".//row")
6457
xml_find_all <- function(x, xpath) {
6558
if (is.list(x)) {
6659
res <- unlist(lapply(x, xml_find_all, xpath = xpath), recursive = FALSE)
@@ -76,8 +69,6 @@ xml_find_all <- function(x, xpath) {
7669
#' @param x A pugi_node or list of nodes.
7770
#' @return A pugi_nodeset of child elements.
7871
#' @keywords internal
79-
#' @examples
80-
#' # xml_children(xml_find_first(doc, ".//row"))
8172
xml_children <- function(x) {
8273
if (is.list(x)) {
8374
res <- unlist(lapply(x, function(node) .Call(C_pugi_children, node)), recursive = FALSE)
@@ -92,8 +83,6 @@ xml_children <- function(x) {
9283
#' @param x A pugi_node or list of nodes.
9384
#' @return A character vector of tag names.
9485
#' @keywords internal
95-
#' @examples
96-
#' # xml_name(xml_find_all(doc, "/*/*"))
9786
xml_name <- function(x) {
9887
if (is.list(x)) return(unname(sapply(x, function(node) .Call(C_pugi_node_name, node))))
9988
# Unwrap document node to its root element, matching xml2 behaviour
@@ -121,8 +110,6 @@ xml_type <- function(x) {
121110
#' @param attr Character string of the attribute name.
122111
#' @return A character vector of attribute values.
123112
#' @keywords internal
124-
#' @examples
125-
#' # xml_attr(rows, "r")
126113
xml_attr <- function(x, attr) {
127114
if (is.list(x)) return(unname(sapply(x, function(node) .Call(C_pugi_get_attr, node, attr))))
128115
.Call(C_pugi_get_attr, x, as.character(attr))
@@ -134,8 +121,6 @@ xml_attr <- function(x, attr) {
134121
#' @param attr Character string of the attribute name.
135122
#' @param value The value to set (coerced to character).
136123
#' @keywords internal
137-
#' @examples
138-
#' # xml_set_attr(rows, "customHeight", "1")
139124
xml_set_attr <- function(x, attr, value) {
140125
if (is.list(x)) {
141126
invisible(lapply(x, function(node) .Call(C_pugi_set_attr, node, attr, as.character(value))))
@@ -150,8 +135,6 @@ xml_set_attr <- function(x, attr, value) {
150135
#' @param attr Character string of the attribute name.
151136
#' @return A logical vector.
152137
#' @keywords internal
153-
#' @examples
154-
#' # has_r <- xml_has_attr(cells, "r")
155138
xml_has_attr <- function(x, attr) {
156139
if (is.list(x)) return(unname(sapply(x, function(node) .Call(C_pugi_has_attr, node, attr))))
157140
.Call(C_pugi_has_attr, x, as.character(attr))
@@ -162,8 +145,6 @@ xml_has_attr <- function(x, attr) {
162145
#' @param x A pugi_node or list of nodes.
163146
#' @return An integer vector of child counts.
164147
#' @keywords internal
165-
#' @examples
166-
#' # xml_length(doc)
167148
xml_length <- function(x) {
168149
if (is.list(x)) return(unname(sapply(x, function(node) .Call(C_pugi_node_length, node))))
169150
.Call(C_pugi_node_length, x)
@@ -173,8 +154,6 @@ xml_length <- function(x) {
173154
#'
174155
#' @param x A pugi_node or list of nodes.
175156
#' @keywords internal
176-
#' @examples
177-
#' # xml_remove(xml_find_all(doc, ".//legacyDrawing"))
178157
xml_remove <- function(x) {
179158
if (is.list(x)) invisible(lapply(x, function(node) .Call(C_pugi_remove, node)))
180159
else if (!is.null(x)) .Call(C_pugi_remove, x)

man/encharter.Rd

Lines changed: 10 additions & 18 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/xml_add_child.Rd

Lines changed: 0 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/xml_attr.Rd

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/xml_children.Rd

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/xml_find_all.Rd

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/xml_find_first.Rd

Lines changed: 0 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)