Skip to content

Commit f95472c

Browse files
committed
doc: refactor doc about flextable selectors
1 parent d84e1d7 commit f95472c

File tree

132 files changed

+1583
-491
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

132 files changed

+1583
-491
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Type: Package
22
Package: flextable
33
Title: Functions for Tabular Reporting
4-
Version: 0.9.11.005
4+
Version: 0.9.11.006
55
Authors@R: c(
66
person("David", "Gohel", , "[email protected]", role = c("aut", "cre")),
77
person("ArData", role = "cph"),

R/append_chunk.R

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,12 +2,9 @@
22
#' @title Append chunks to flextable content
33
#' @description append chunks (for example chunk [as_chunk()])
44
#' in a flextable.
5-
#' @param x a flextable object
5+
#' @inheritParams args_selectors_without_all
66
#' @param ... chunks to be appened, see [as_chunk()], [gg_chunk()] and other
77
#' chunk elements for paragraph.
8-
#' @param i rows selection
9-
#' @param j column selection
10-
#' @param part partname of the table (one of 'body', 'header', 'footer')
118
#' @seealso [as_chunk()], [as_sup()], [as_sub()], [colorize()]
129
#' @family functions for mixed content paragraphs
1310
#' @examples
@@ -60,12 +57,9 @@ append_chunks <- function(x, ..., i = NULL, j = NULL, part = "body") {
6057
#' @title Prepend chunks to flextable content
6158
#' @description prepend chunks (for example chunk [as_chunk()])
6259
#' in a flextable.
63-
#' @param x a flextable object
60+
#' @inheritParams args_selectors_without_all
6461
#' @param ... chunks to be prepended, see [as_chunk()], [gg_chunk()] and other
6562
#' chunk elements for paragraph.
66-
#' @param i rows selection
67-
#' @param j column selection
68-
#' @param part partname of the table (one of 'body', 'header', 'footer')
6963
#' @family functions for mixed content paragraphs
7064
#' @examples
7165
#' x <- flextable(head(iris))

R/augment_rows.R

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#' @description This function set labels for specified
44
#' columns in the bottom row header of a flextable.
55
#'
6-
#' @param x a `flextable` object
6+
#' @inheritParams args_x_only
77
#' @param ... named arguments (names are data colnames), each element is a single character
88
#' value specifying label to use.
99
#' @param values a named list (names are data colnames), each element is a single character
@@ -103,8 +103,7 @@ set_header_labels <- function(x, ..., values = NULL) {
103103
#' @description indicate to not print a part of
104104
#' the flextable, i.e. an header, footer or the body.
105105
#'
106-
#' @param x a `flextable` object
107-
#' @param part partname of the table to delete (one of 'body', 'header' or 'footer').
106+
#' @inheritParams args_x_part_no_all
108107
#' @family functions for row and column operations in a flextable
109108
#' @examples
110109
#' ft <- flextable(head(iris))
@@ -157,10 +156,7 @@ delete_rows_from_part <- function(x, i) {
157156
#' of any span parameters that may have been set previously.
158157
#' They will have to be redone after this operation or
159158
#' performed only after this deletion.
160-
#' @param x a `flextable` object
161-
#' @param i rows selection
162-
#' @param part partname of the table (one of 'all', 'body', 'header', 'footer')
163-
#' @family functions for row and column operations in a flextable
159+
#' @inheritParams args_x_i_part
164160
#' @examples
165161
#' ft <- flextable(head(iris))
166162
#' ft <- delete_rows(ft, i = 1:5, part = "body")
@@ -222,8 +218,7 @@ delete_colums_from_part <- function(x, j) {
222218
#' of any span parameters that may have been set previously.
223219
#' They will have to be redone after this operation or
224220
#' performed only after this deletion.
225-
#' @param x a `flextable` object
226-
#' @param j columns selection
221+
#' @inheritParams args_x_j
227222
#' @family functions for row and column operations in a flextable
228223
#' @examples
229224
#' ft <- flextable(head(iris))
@@ -317,7 +312,7 @@ add_rows_to_tabpart <- function(x, rows, first = FALSE) {
317312
#'
318313
#' If some columns are not provided, they will be replaced by
319314
#' `NA` and displayed as empty.
320-
#' @param x a flextable object
315+
#' @inheritParams args_x_only
321316
#' @param top should the rows be inserted at the top or the bottom.
322317
#' @param ... named arguments (names are data colnames) of values
323318
#' to add. It is important to insert data of the same type as the
@@ -480,7 +475,7 @@ add_footer <- function(x, top = TRUE, ..., values = NULL) {
480475
#'
481476
#' Labels can also be formatted with [as_paragraph()].
482477
#'
483-
#' @param x a flextable object
478+
#' @inheritParams args_x_only
484479
#' @param top should the row be inserted at the top or the bottom.
485480
#' @param values values to add. It can be a `list`, a `character()` vector
486481
#' or a call to [as_paragraph()].
@@ -605,7 +600,7 @@ add_body_row <- function(x, top = TRUE, values = list(), colwidths = integer(0))
605600
#'
606601
#' Labels can also be formatted with [as_paragraph()].
607602
#'
608-
#' @param x a flextable object
603+
#' @inheritParams args_x_only
609604
#' @param top should the row be inserted at the
610605
#' top or the bottom. Default to TRUE.
611606
#' @param values values to add, a character vector (as header rows
@@ -825,13 +820,13 @@ data_from_char <- function(values, colwidths, col_keys) {
825820
#' add labels in the header, most of the time it will
826821
#' be used to adding titles on the top rows of the flextable.
827822
#'
828-
#' @param x a `flextable` object
823+
#' @inheritParams args_x_only
829824
#' @param values a character vector or a call to [as_paragraph()]
830825
#' to get formated content, each element will
831826
#' be added as a new row.
832827
#' @param top should the row be inserted at the top
833828
#' or the bottom. Default to TRUE.
834-
#' @family functions that add rows in the table
829+
#' @family functions for row and column operations in a flextable
835830
#' @examples
836831
#' # ex 1----
837832
#' ft_1 <- flextable(head(iris))
@@ -993,7 +988,7 @@ set_part_df <- function(x, mapping = NULL, key = "col_keys", part) {
993988
#' is used as the top header/footer row and the rightmost column
994989
#' is used as the bottom header/footer row.
995990
#'
996-
#' @param x a `flextable` object
991+
#' @inheritParams args_x_only
997992
#' @param mapping a `data.frame` specyfing for each colname
998993
#' content of the column.
999994
#' @param key column to use as key when joigning data_mapping.
@@ -1059,7 +1054,7 @@ set_footer_df <- function(x, mapping = NULL, key = "col_keys") {
10591054
#' \if{html}{\out{
10601055
#' <img src="https://www.ardata.fr/img/flextable-imgs/flextable-016.png" alt="add_header illustration" style="width:100\%;">
10611056
#' }}
1062-
#' @param x a flextable object
1057+
#' @inheritParams args_x_only
10631058
#' @param opts Optional treatments to apply to the resulting header part.
10641059
#' This should be a character vector with support for multiple values.
10651060
#'

R/border_fix.R

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@
88
#'
99
#' Note since version `0.9.7` that the function is called automatically
1010
#' before rendering, user should not have to call this function anymore.
11-
#' @param x flextable object
12-
#' @param part partname of the table (one of 'all', 'body', 'header', 'footer')
11+
#' @inheritParams args_x_part
1312
#' @examples
1413
#' library(officer)
1514
#' dat <- data.frame(a = 1:5, b = 6:10)

0 commit comments

Comments
 (0)