Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions R/char.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#'
#' These functions are reexported as [tibble::char()] and [tibble::set_char_opts()].
#'
#' @return A `pillar_char` vector for `char()`, or `x` with pillar attributes
#' set for `set_char_opts()`.
#' @keywords internal
#' @export
char <- function(x, ..., min_chars = NULL,
Expand Down
2 changes: 2 additions & 0 deletions R/ctl_new_pillar.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,8 @@
#' @param width The available width, can be a vector for multiple tiers.
#' @param title The title, derived from the name of the column in the data.
#'
#' @return A pillar object, or `NULL` if none of the data fits the available width.
#'
#' @seealso
#' See [ctl_new_pillar_list()] for creating pillar objects for compound columns:
#' packed data frames, matrices, or arrays.
Expand Down
1 change: 1 addition & 0 deletions R/ctl_new_pillar_list.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#' @param first_pillar Can be passed to this method if the first pillar
#' for a compound pillar (or the pillar itself for a simple pillar)
#' has been constructed already.
#' @return A list of pillar objects.
#' @export
#' @examplesIf rlang::is_installed(c("palmerpenguins", "tibble")) && requireNamespace("tibble")
#' # Simple column
Expand Down
3 changes: 3 additions & 0 deletions R/ctl_pillar.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@
#' used "as is", no quoting will be applied.
#' @param width Default width, optional.
#' @param ... Passed on to [pillar_shaft()].
#' @return A pillar object, or `NULL` if the width is insufficient
#' to display the data.
#' @export
#' @examples
#' x <- 123456789 * (10^c(-1, -3, -5, NA, -8, -10))
Expand Down Expand Up @@ -129,6 +131,7 @@ pillar_from_shaft <- function(title, type, data, width) {
#' @param class Name of subclass.
#' @param extra Deprecated.
#'
#' @return A pillar object with the given components.
#' @export
#' @examples
#' lines <- function(char = "-") {
Expand Down
1 change: 1 addition & 0 deletions R/ctl_pillar_component.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@
#' (for `pillar_component()`).
#' @param width,min_width Width and minimum width for the new component.
#' If `min_width` is `NULL`, it is assumed to match `width`.
#' @return A `"pillar_component"` object.
#' @export
#' @examples
#' new_pillar_component(list(letters[1:3]), width = 1)
Expand Down
2 changes: 2 additions & 0 deletions R/dim.R
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
#'
#' @param x The object to format the dimensions for
#'
#' @return A string describing the dimensions, e.g. `"10"` for a vector
#' or `"32 x 11"` for a data frame.
#' @export
#' @examples
#' dim_desc(1:10)
Expand Down
4 changes: 4 additions & 0 deletions R/extent.R
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
#' vector.
#'
#' @param x A character vector.
#' @return An integer vector of display widths, one per element of `x`.
#' @export
#' @importFrom cli ansi_strip
#' @importFrom cli utf8_nchar
Expand All @@ -24,6 +25,8 @@ get_extent <- function(x) {
#' @description
#' `get_max_extent()` calculates the maximum display width of all strings in a
#' character vector, zero for empty vectors.
#'
#' @return A single integer value representing the maximum display width.
#' @export
#' @rdname get_extent
#' @examples
Expand All @@ -43,6 +46,7 @@ get_max_extent <- function(x) {
#' @param align How should strings be aligned? If `align = left` then padding
#' appears on the `right`, and vice versa.
#' @param space What character should be used for the padding?
#' @return A character vector of aligned and padded strings.
#' @export
#' @examples
#' align(c("abc", "de"), align = "left")
Expand Down
1 change: 1 addition & 0 deletions R/ggplot2.R
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
#' @inheritDotParams ggplot2::continuous_scale -scale_name
#' @param guide,position Passed on to [ggplot2::continuous_scale()]
#' @param rescaler,super Must remain `NULL`.
#' @return A ggplot2 scale object.
#'
#' @keywords internal
#' @export
Expand Down
2 changes: 2 additions & 0 deletions R/num.R
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@
#'
#' These functions are reexported as [tibble::num()] and [tibble::set_num_opts()].
#'
#' @return A `pillar_num` vector for `num()`, or `x` with pillar attributes
#' set for `set_num_opts()`.
#' @keywords internal
#' @export
num <- function(x, ...,
Expand Down
3 changes: 2 additions & 1 deletion R/ornament.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,13 @@
#' `pillar_shaft.numeric()` and `format.pillar_shaft_decimal()` for an example.
#'
#' @param x A character vector with formatting,
#' can use ANYI styles e.g provided by the \pkg{cli} package.
#' can use ANSI styles e.g provided by the \pkg{cli} package.
#'
#' @param width An optional width of the resulting pillar, computed from `x` if
#' missing
#' @param align Alignment, one of `"left"` or `"right"`
#'
#' @return A `pillar_ornament` object.
#' @export
#' @examples
#' new_ornament(c("abc", "de"), align = "right")
Expand Down
2 changes: 2 additions & 0 deletions R/shaft-.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
#' [type_sum()].
#' @param class The name of the subclass.
#' @param subclass Deprecated, pass the `class` argument instead.
#' @return A pillar shaft object of class `c(class, "pillar_shaft")`.
#' @name new_pillar_shaft
#' @export
new_pillar_shaft <- function(x, ..., width = NULL, min_width = width,
Expand Down Expand Up @@ -62,6 +63,7 @@ new_pillar_shaft <- function(x, ..., width = NULL, min_width = width,
#'
#' @param x A vector to format
#' @inheritParams rlang::args_dots_used
#' @return A pillar shaft object.
#' @export
#' @examples
#' pillar_shaft(1:3)
Expand Down
1 change: 1 addition & 0 deletions R/styles.R
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ keep_empty <- function(fun) {
#' `style_subtle()` is affected by the `subtle` [option][pillar_options].
#'
#' @param x The character vector to style.
#' @return A styled character vector.
#' @export
#' @seealso [pillar_options] for a list of options
#' @examples
Expand Down
2 changes: 2 additions & 0 deletions R/tbl-format-setup.R
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,8 @@ tbl_format_setup.tbl <- function(
#'
#' @param x A tbl object.
#' @inheritParams rlang::args_dots_empty
#' @return A single integer, or `NA` if the number of rows is unknown
#' (e.g., for lazy tables).
#' @export
tbl_nrow <- function(x, ...) {
check_dots_empty0(...)
Expand Down
1 change: 1 addition & 0 deletions R/title.R
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ style_title <- style_bold
#'
#' @param x A character vector of column titles.
#' @inheritParams rlang::args_dots_empty
#' @return A `"pillar_title"` object.
#' @export
#' @examples
#' format(new_pillar_title(names(trees)))
Expand Down
7 changes: 7 additions & 0 deletions R/type-sum.R
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
#' @param x an object to summarise. Generally only methods of atomic vectors
#' and variants have been implemented.
#'
#' @return A string with four or less characters summarising the type of `x`.
#' @export
type_sum <- function(x) {
UseMethod("type_sum")
Expand Down Expand Up @@ -72,6 +73,9 @@ vec_ptype_abbr.pillar_empty_col <- function(x, ...) {
#' An attribute named `"short"` in the return value will be picked up by
#' the [pillar_shaft()] method for lists, and used if space is limited.
#'
#' @return A string summarising the object, including its type and size
#' for vectors. An attribute named `"short"` may contain a shorter version.
#'
#' @examples
#' obj_sum(1:10)
#' obj_sum(matrix(1:10))
Expand Down Expand Up @@ -114,6 +118,9 @@ obj_sum.AsIs <- function(x) {
#' it can be an empty string `""` to omit size information,
#' this is what the default method does for scalars.
#'
#' @return A string describing the size, e.g. `"[10]"` or `"[32 x 11]"`.
#' Returns `""` for scalars.
#'
#' @keywords internal
#' @examples
#'
Expand Down
2 changes: 2 additions & 0 deletions R/type.R
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ style_type <- function(x) {
#'
#' @param x A vector for which the type is to be retrieved.
#' @inheritParams rlang::args_dots_empty
#' @return A `"pillar_type"` object.
#' @export
#' @examples
#' format(new_pillar_type("a"))
Expand Down Expand Up @@ -72,6 +73,7 @@ format_full_pillar_type <- function(x) {
#' @param width The desired total width. If the returned string still is
#' wider, it will be trimmed. Can be `NULL`.
#' @inheritParams rlang::args_dots_used
#' @return A styled character string summarising the type.
#'
#' @export
#' @examples
Expand Down
3 changes: 3 additions & 0 deletions man/align.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions man/char.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/ctl_new_pillar.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/ctl_new_pillar_list.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions man/dim_desc.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/format_type_sum.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 5 additions & 0 deletions man/get_extent.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 4 additions & 1 deletion man/new_ornament.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/new_pillar.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/new_pillar_component.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/new_pillar_shaft.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/new_pillar_title.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/new_pillar_type.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions man/num.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions man/pillar.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/pillar_shaft.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/scale_x_num.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions man/style_subtle.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading
Loading