From 795b9662e033e8f06172099203d5d72e20bec774 Mon Sep 17 00:00:00 2001 From: Hadley Wickham Date: Thu, 24 Mar 2022 13:16:34 -0500 Subject: [PATCH] Consistently format superseded functions (#333) Fixes #308 --- R/breaks-retired.R | 6 +++ R/breaks.r | 14 +++++-- R/label-date.R | 18 ++++++--- R/label-dollar.R | 19 +++++---- R/label-expression.R | 18 ++++++--- R/label-log.R | 2 +- R/label-number-si.R | 2 +- R/label-number.r | 21 ++++++---- R/label-ordinal.R | 18 ++++++--- R/label-percent.R | 18 ++++++--- R/label-pvalue.R | 19 ++++++--- R/label-scientific.R | 18 ++++++--- R/label-wrap.R | 15 +++++-- R/labels-retired.R | 6 +++ _pkgdown.yml | 8 ++-- man/breaks_pretty.Rd | 4 -- man/cbreaks.Rd | 1 + man/comma.Rd | 81 +++++++++++++++++++++++++++++++++++++ man/date_breaks.Rd | 1 + man/date_format.Rd | 28 +++++++++++++ man/dollar_format.Rd | 82 ++++++++++++++++++++++++++++++++++++++ man/format_format.Rd | 1 + man/label_date.Rd | 12 ------ man/label_dollar.Rd | 39 ------------------ man/label_number.Rd | 47 ---------------------- man/label_ordinal.Rd | 27 ------------- man/label_parse.Rd | 12 ------ man/label_percent.Rd | 33 --------------- man/label_pvalue.Rd | 19 --------- man/label_scientific.Rd | 31 -------------- man/label_wrap.Rd | 8 ---- man/number.Rd | 2 - man/number_bytes_format.Rd | 1 + man/ordinal_format.Rd | 43 ++++++++++++++++++++ man/parse_format.Rd | 25 ++++++++++++ man/percent_format.Rd | 63 +++++++++++++++++++++++++++++ man/pretty_breaks.Rd | 21 ++++++++++ man/pvalue_format.Rd | 40 +++++++++++++++++++ man/scientific_format.Rd | 54 +++++++++++++++++++++++++ man/trans_breaks.Rd | 1 + man/unit_format.Rd | 1 + man/wrap_format.Rd | 18 +++++++++ 42 files changed, 600 insertions(+), 297 deletions(-) create mode 100644 man/comma.Rd create mode 100644 man/date_format.Rd create mode 100644 man/dollar_format.Rd create mode 100644 man/ordinal_format.Rd create mode 100644 man/parse_format.Rd create mode 100644 man/percent_format.Rd create mode 100644 man/pretty_breaks.Rd create mode 100644 man/pvalue_format.Rd create mode 100644 man/scientific_format.Rd create mode 100644 man/wrap_format.Rd diff --git a/R/breaks-retired.R b/R/breaks-retired.R index dd9b061d..bd6bea03 100644 --- a/R/breaks-retired.R +++ b/R/breaks-retired.R @@ -1,6 +1,8 @@ #' Regularly spaced dates #' +#' @description #' `r lifecycle::badge('superseded')` +#' #' Use `breaks_width()` instead. #' #' @param width an interval specification, one of "sec", "min", "hour", @@ -15,7 +17,9 @@ date_breaks <- function(width = "1 month") { #' Pretty breaks on transformed scale #' +#' @description #' `r lifecycle::badge('superseded')` +#' #' These often do not produce very attractive breaks. #' #' @param trans function of single variable, `x`, that given a numeric @@ -42,7 +46,9 @@ trans_breaks <- function(trans, inv, n = 5, ...) { #' Compute breaks for continuous scale #' +#' @description #' `r lifecycle::badge('superseded')` +#' #' This function wraps up the components needed to go from a continuous range #' to a set of breaks and labels suitable for display on axes or legends. #' diff --git a/R/breaks.r b/R/breaks.r index bcd3acc0..439580f7 100644 --- a/R/breaks.r +++ b/R/breaks.r @@ -103,8 +103,6 @@ extended_breaks <- breaks_extended #' primarily useful for date/times, as [extended_breaks()] should do a slightly #' better job for numeric scales. #' -#' `pretty_breaks()` is superseded; use `breaks_pretty()` instead. -#' #' @inheritParams breaks_extended #' @param ... other arguments passed on to [pretty()] #' @export @@ -130,7 +128,15 @@ breaks_pretty <- function(n = 5, ...) { } } +#' Superseded interface to `breaks_pretty()` +#' +#' @description +#' `r lifecycle::badge("superseded")` +#' +#' These functions are kept for backward compatibility; you should switch +#' to [breaks_pretty()] for new code. +#' +#' @keywords internal #' @export -#' @usage NULL -#' @rdname breaks_pretty +#' @inheritParams breaks_pretty pretty_breaks <- breaks_pretty diff --git a/R/label-date.R b/R/label-date.R index 0b908bdc..684aa8e4 100644 --- a/R/label-date.R +++ b/R/label-date.R @@ -8,10 +8,7 @@ #' "firsts" (e.g. first day of month, first day of day) specially; #' `date_short()` formats changes (e.g. new month, new year) specially. #' -#' @section Old interface: -#' `date_format()` and `time_format()` are superseded; please use `label_date()` -#' and `label_time()` instead. -#' @inherit number_format return +#' @inherit label_number return #' @param format For `date_format()` and `time_format()` a date/time format #' string using standard POSIX specification. See [strptime()] for details. #' @@ -114,10 +111,19 @@ label_time <- function(format = "%H:%M:%S", tz = "UTC") { } +#' Superseded interface to `label_date()`/`label_time()` +#' +#' @description +#' `r lifecycle::badge("superseded")` +#' +#' These functions are kept for backward compatibility; you should switch +#' to [label_date()/[label_time()] for new code. +#' +#' @keywords internal #' @export -#' @rdname label_date +#' @inheritParams label_date date_format <- label_date #' @export -#' @rdname label_date +#' @rdname date_format time_format <- label_time diff --git a/R/label-dollar.R b/R/label-dollar.R index 61bfdcd7..23adc46d 100644 --- a/R/label-dollar.R +++ b/R/label-dollar.R @@ -3,11 +3,7 @@ #' Format numbers as currency, rounding values to dollars or cents using #' a convenient heuristic. #' -#' @section Old interface: -#' `dollar()` and `format_dollar()` are superseded; please use `label_dollar()` -#' instead. -#' -#' @inherit number_format return params +#' @inherit label_number return params #' @param accuracy,largest_with_cents Number to round to. If `NULL`, the default, #' values will be rounded to the nearest integer, unless any of the #' values has non-zero fractional component (e.g. cents) and the largest @@ -101,12 +97,21 @@ needs_cents <- function(x, threshold) { !all(x == floor(x), na.rm = TRUE) } +#' Superseded interface to `label_dollar()` +#' +#' @description +#' `r lifecycle::badge("superseded")` +#' +#' These functions are kept for backward compatibility; you should switch +#' to [label_dollar()] for new code. +#' +#' @keywords internal #' @export -#' @rdname label_dollar +#' @inheritParams label_dollar dollar_format <- label_dollar #' @export -#' @rdname label_dollar +#' @rdname dollar_format #' @param x A numeric vector dollar <- function(x, accuracy = NULL, scale = 1, prefix = "$", suffix = "", big.mark = ",", decimal.mark = ".", diff --git a/R/label-expression.R b/R/label-expression.R index bd702cce..7bb5f8ac 100644 --- a/R/label-expression.R +++ b/R/label-expression.R @@ -4,10 +4,7 @@ #' `label_math()` constructs expressions by replacing the pronoun `.x` #' with each string. #' -#' @section Old interface: -#' `parse_format()` and `math_format()` was superseded; please use -#' `label_parse()` and `label_math()` instead. -#' @inherit number_format return +#' @inherit label_number return #' @seealso [plotmath] for the details of mathematical formatting in R. #' @export #' @family labels for continuous scales @@ -54,10 +51,19 @@ label_math <- function(expr = 10^.x, format = force) { } } -#' @rdname label_parse +#' Superseded interface to `label_parse()`/`label_math()` +#' +#' @description +#' `r lifecycle::badge("superseded")` +#' +#' These functions are kept for backward compatibility; you should switch +#' to [label_parse()]/[label_math()] for new code. +#' +#' @keywords internal #' @export +#' @inheritParams label_parse parse_format <- label_parse -#' @rdname label_parse +#' @rdname parse_format #' @export math_format <- label_math diff --git a/R/label-log.R b/R/label-log.R index ecd37914..802d2a13 100644 --- a/R/label-log.R +++ b/R/label-log.R @@ -5,7 +5,7 @@ #' @param base Base of logarithm to use #' @param digits Number of significant digits to show for the exponent. Argument #' is passed on to [base::format()]. -#' @inherit number_format return +#' @inherit label_number return #' @seealso [breaks_log()] for the related breaks algorithm. #' @export #' @family labels for log scales diff --git a/R/label-number-si.R b/R/label-number-si.R index f50f0a17..a18c6d47 100644 --- a/R/label-number-si.R +++ b/R/label-number-si.R @@ -6,7 +6,7 @@ #' See [Metric Prefix](https://en.wikipedia.org/wiki/Metric_prefix) on Wikipedia #' for more details. #' -#' @inherit number_format return params +#' @inherit label_number return params #' @param unit Unit of measurement (e.g. `"m"` for meter, the SI unit of length). #' @param scale A scaling factor: `x` will be multiplied by `scale` before #' formatting. This is useful if the underlying data is already using an SI diff --git a/R/label-number.r b/R/label-number.r index 2ad52dc3..d7ffb959 100644 --- a/R/label-number.r +++ b/R/label-number.r @@ -13,10 +13,7 @@ #' ggplot2 scales. The examples demonstrate their use with x scales, but #' they work similarly for all scales, including those that generate legends #' rather than axes. -#' @section Old interface: -#' `number_format()`, `comma_format()`, and `comma()` are superseded; please use -#' `label_number()` and `label_comma()` instead. -#' @param x A numeric vector to format. +#' #' @param accuracy A number to round to. Use (e.g.) `0.01` to show 2 decimal #' places of precision. If `NULL`, the default, uses a heuristic that should #' ensure breaks have the minimum number of digits needed to show the @@ -102,8 +99,18 @@ label_comma <- function(accuracy = NULL, scale = 1, prefix = "", ) } +#' Superseded interface to `label_number()`/`label_comma()` +#' +#' @description +#' `r lifecycle::badge("superseded")` +#' +#' These functions are kept for backward compatibility; you should switch +#' to [label_number()]/[label_comma()] for new code. +#' +#' @keywords internal #' @export -#' @rdname label_number +#' @inheritParams label_number +#' @param x A numeric vector to format. comma <- function(x, accuracy = NULL, scale = 1, prefix = "", suffix = "", big.mark = ",", decimal.mark = ".", trim = TRUE, digits, ...) { @@ -127,11 +134,11 @@ comma <- function(x, accuracy = NULL, scale = 1, prefix = "", } #' @export -#' @rdname label_number +#' @rdname comma number_format <- label_number #' @export -#' @rdname label_number +#' @rdname comma comma_format <- label_comma #' A low-level numeric formatter diff --git a/R/label-ordinal.R b/R/label-ordinal.R index 3827794f..1a86858f 100644 --- a/R/label-ordinal.R +++ b/R/label-ordinal.R @@ -3,10 +3,7 @@ #' Round values to integers and then display as ordinal values (e.g. 1st, 2nd, #' 3rd). Built-in rules are provided for English, French, and Spanish. #' -#' @section Old interface: -#' `ordinal()` and `format_ordinal()` are superseded; please use `label_ordinal()` -#' instead. -#' @inherit number_format return params +#' @inherit label_number return params #' @param prefix,suffix Symbols to display before and after value. #' @param rules Named list of regular expressions, matched in order. #' Name gives suffix, and value specifies which numbers to match. @@ -83,12 +80,21 @@ ordinal_spanish <- function() { stats::setNames(list("."), ".\u00ba") } +#' Superseded interface to `label_ordinal()` +#' +#' @description +#' `r lifecycle::badge("superseded")` +#' +#' These functions are kept for backward compatibility; you should switch +#' to [label_ordinal()] for new code. +#' +#' @keywords internal #' @export -#' @rdname label_ordinal +#' @inheritParams label_ordinal ordinal_format <- label_ordinal #' @export -#' @rdname label_ordinal +#' @rdname ordinal_format ordinal <- function(x, prefix = "", suffix = "", big.mark = " ", rules = ordinal_english(), ...) { na_idx <- is.na(x) diff --git a/R/label-percent.R b/R/label-percent.R index a6e6c8fa..fdc64eb7 100644 --- a/R/label-percent.R +++ b/R/label-percent.R @@ -1,9 +1,6 @@ #' Label percentages (2.5%, 50%, etc) #' -#' @section Old interface: -#' `percent()` and `percent_format()` are superseded; please use `label_percent()` -#' instead. -#' @inherit number_format return params +#' @inherit label_number return params #' @export #' @family labels for continuous scales #' @examples @@ -31,12 +28,21 @@ label_percent <- function(accuracy = NULL, scale = 100, prefix = "", ) } +#' Superseded interface to `label_percent()` +#' +#' @description +#' `r lifecycle::badge("superseded")` +#' +#' These functions are kept for backward compatibility; you should switch +#' to [label_percent()] for new code. +#' +#' @keywords internal #' @export -#' @rdname label_percent +#' @inheritParams label_percent percent_format <- label_percent #' @export -#' @rdname label_percent +#' @rdname percent_format percent <- function(x, accuracy = NULL, scale = 100, prefix = "", suffix = "%", big.mark = " ", decimal.mark = ".", trim = TRUE, ...) { diff --git a/R/label-pvalue.R b/R/label-pvalue.R index 5fc296e1..8de008b7 100644 --- a/R/label-pvalue.R +++ b/R/label-pvalue.R @@ -2,10 +2,7 @@ #' #' Formatter for p-values, using "<" and ">" for p-values close to 0 and 1. #' -#' @section Old interface: -#' `pvalue()` and `pvalue_format()` are superseded; please use `label_pvalue()` -#' instead. -#' @inherit number_format return params +#' @inherit label_number return params #' @param prefix A character vector of length 3 giving the prefixes to #' put in front of numbers. The default values are `c("<", "", ">")` #' if `add_p` is `TRUE` and `c("p<", "p=", "p>")` if `FALSE`. @@ -34,11 +31,21 @@ label_pvalue <- function(accuracy = .001, decimal.mark = ".", prefix = NULL, add } } -#' @rdname label_pvalue +#' Superseded interface to `label_pvalue()` +#' +#' @description +#' `r lifecycle::badge("superseded")` +#' +#' These functions are kept for backward compatibility; you should switch +#' to [label_pvalue()] for new code. +#' +#' @keywords internal +#' @export +#' @inheritParams label_pvalue #' @export pvalue_format <- label_pvalue -#' @rdname label_pvalue +#' @rdname pvalue_format #' @export pvalue <- function(x, accuracy = .001, diff --git a/R/label-scientific.R b/R/label-scientific.R index da579288..694073d9 100644 --- a/R/label-scientific.R +++ b/R/label-scientific.R @@ -1,9 +1,6 @@ #' Label numbers with scientific notation (e.g. 1e05, 1.5e-02) #' -#' @section Old interface: -#' `scientific_format()` and `scientific()` are superseded; please use -#' `label_scientific()`. -#' @inherit number_format return params +#' @inherit label_number return params #' @param digits Number of digits to show before exponent. #' @param prefix,suffix Symbols to display before and after value. #' @param ... Other arguments passed on to [base::format()]. @@ -32,12 +29,21 @@ label_scientific <- function(digits = 3, scale = 1, prefix = "", suffix = "", } } +#' Superseded interface to `label_scientific()` +#' +#' @description +#' `r lifecycle::badge("superseded")` +#' +#' These functions are kept for backward compatibility; you should switch +#' to [label_scientific()] for new code. +#' +#' @keywords internal #' @export -#' @rdname label_scientific +#' @inheritParams label_scientific scientific_format <- label_scientific #' @export -#' @rdname label_scientific +#' @rdname scientific_format scientific <- function(x, digits = 3, scale = 1, prefix = "", suffix = "", decimal.mark = ".", trim = TRUE, ...) { if (length(x) == 0) { diff --git a/R/label-wrap.R b/R/label-wrap.R index 938a345e..645b8650 100644 --- a/R/label-wrap.R +++ b/R/label-wrap.R @@ -2,9 +2,7 @@ #' #' Uses [strwrap()] to split long labels across multiple lines. #' -#' @section Old interface: -#' `wrap_format()` is superseded; please use `label_format()` instead. -#' @inherit number_format return +#' @inherit label_number return #' @param width Number of characters per line. #' @export #' @family labels for discrete scales @@ -24,6 +22,15 @@ label_wrap <- function(width) { } } +#' Superseded interface to `label_wrap()` +#' +#' @description +#' `r lifecycle::badge("superseded")` +#' +#' These functions are kept for backward compatibility; you should switch +#' to [label_wrap()] for new code. +#' +#' @keywords internal #' @export -#' @rdname label_wrap +#' @inheritParams label_wrap wrap_format <- label_wrap diff --git a/R/labels-retired.R b/R/labels-retired.R index cb4275d1..41d37036 100644 --- a/R/labels-retired.R +++ b/R/labels-retired.R @@ -1,6 +1,8 @@ #' Older interface to `label_bytes()` #' +#' @description #' `r lifecycle::badge('superseded')` +#' #' These functions are kept for backward compatibility, but you should switch #' to [label_bytes()] for new code. #' @@ -93,7 +95,9 @@ trans_format <- function(trans, format = scientific_format()) { #' Unit labels #' +#' @description #' `r lifecycle::badge('superseded')` +#' #' This function is kept for backward compatiblity; you should either use #' [label_number()] or [label_number_si()] instead. #' @@ -126,7 +130,9 @@ unit_format <- function(accuracy = NULL, scale = 1, prefix = "", #' Label using `format()` #' +#' @description #' `r lifecycle::badge('superseded')` +#' #' This function is kept for backward compatiblity; you should either use #' [label_number()] or [label_date()] instead. #' diff --git a/_pkgdown.yml b/_pkgdown.yml index 9c8ce29d..045e2e81 100644 --- a/_pkgdown.yml +++ b/_pkgdown.yml @@ -29,14 +29,17 @@ reference: desc: > Functions for rescaling data and adjusting scale ranges. contents: - - starts_with("rescale") + - rescale + - rescale_max + - rescale_mid + - rescale_none + - rescale_pal - matches("range") - squish - squish_infinite - expand_range - discard - censor - - -Range - title: Transformations desc: > @@ -44,7 +47,6 @@ reference: their inverses, and ways of generating breaks and labels. contents: - matches("trans") - - -trans_breaks - title: "Colour palettes & colour mapping" desc: > diff --git a/man/breaks_pretty.Rd b/man/breaks_pretty.Rd index dfe26274..5a43a4c8 100644 --- a/man/breaks_pretty.Rd +++ b/man/breaks_pretty.Rd @@ -2,7 +2,6 @@ % Please edit documentation in R/breaks.r \name{breaks_pretty} \alias{breaks_pretty} -\alias{pretty_breaks} \title{Pretty breaks for date/times} \usage{ breaks_pretty(n = 5, ...) @@ -18,9 +17,6 @@ Uses default R break algorithm as implemented in \code{\link[=pretty]{pretty()}} primarily useful for date/times, as \code{\link[=extended_breaks]{extended_breaks()}} should do a slightly better job for numeric scales. } -\details{ -\code{pretty_breaks()} is superseded; use \code{breaks_pretty()} instead. -} \examples{ one_month <- as.POSIXct(c("2020-05-01", "2020-06-01")) demo_datetime(one_month) diff --git a/man/cbreaks.Rd b/man/cbreaks.Rd index 0f380fb7..1f9258b6 100644 --- a/man/cbreaks.Rd +++ b/man/cbreaks.Rd @@ -21,6 +21,7 @@ what the breaks will be.} } \description{ \ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#superseded}{\figure{lifecycle-superseded.svg}{options: alt='[Superseded]'}}}{\strong{[Superseded]}} + This function wraps up the components needed to go from a continuous range to a set of breaks and labels suitable for display on axes or legends. } diff --git a/man/comma.Rd b/man/comma.Rd new file mode 100644 index 00000000..88be2cb7 --- /dev/null +++ b/man/comma.Rd @@ -0,0 +1,81 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/label-number.r +\name{comma} +\alias{comma} +\alias{number_format} +\alias{comma_format} +\title{Superseded interface to \code{label_number()}/\code{label_comma()}} +\usage{ +comma( + x, + accuracy = NULL, + scale = 1, + prefix = "", + suffix = "", + big.mark = ",", + decimal.mark = ".", + trim = TRUE, + digits, + ... +) + +number_format( + accuracy = NULL, + scale = 1, + prefix = "", + suffix = "", + big.mark = " ", + decimal.mark = ".", + trim = TRUE, + ... +) + +comma_format( + accuracy = NULL, + scale = 1, + prefix = "", + suffix = "", + big.mark = ",", + decimal.mark = ".", + trim = TRUE, + digits, + ... +) +} +\arguments{ +\item{x}{A numeric vector to format.} + +\item{accuracy}{A number to round to. Use (e.g.) \code{0.01} to show 2 decimal +places of precision. If \code{NULL}, the default, uses a heuristic that should +ensure breaks have the minimum number of digits needed to show the +difference between adjacent values. + +Applied to rescaled data.} + +\item{scale}{A scaling factor: \code{x} will be multiplied by \code{scale} before +formatting. This is useful if the underlying data is very small or very +large.} + +\item{prefix}{Symbols to display before and after value.} + +\item{suffix}{Symbols to display before and after value.} + +\item{big.mark}{Character used between every 3 digits to separate thousands.} + +\item{decimal.mark}{The character to be used to indicate the numeric +decimal point.} + +\item{trim}{Logical, if \code{FALSE}, values are right-justified to a common +width (see \code{\link[base:format]{base::format()}}).} + +\item{digits}{Deprecated, use \code{accuracy} instead.} + +\item{...}{Other arguments passed on to \code{\link[base:format]{base::format()}}.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#superseded}{\figure{lifecycle-superseded.svg}{options: alt='[Superseded]'}}}{\strong{[Superseded]}} + +These functions are kept for backward compatibility; you should switch +to \code{\link[=label_number]{label_number()}}/\code{\link[=label_comma]{label_comma()}} for new code. +} +\keyword{internal} diff --git a/man/date_breaks.Rd b/man/date_breaks.Rd index 08ae5cd7..8f7f9d71 100644 --- a/man/date_breaks.Rd +++ b/man/date_breaks.Rd @@ -13,6 +13,7 @@ followed by "s". Fractional seconds are supported.} } \description{ \ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#superseded}{\figure{lifecycle-superseded.svg}{options: alt='[Superseded]'}}}{\strong{[Superseded]}} + Use \code{breaks_width()} instead. } \keyword{internal} diff --git a/man/date_format.Rd b/man/date_format.Rd new file mode 100644 index 00000000..9a966859 --- /dev/null +++ b/man/date_format.Rd @@ -0,0 +1,28 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/label-date.R +\name{date_format} +\alias{date_format} +\alias{time_format} +\title{Superseded interface to \code{label_date()}/\code{label_time()}} +\usage{ +date_format(format = "\%Y-\%m-\%d", tz = "UTC") + +time_format(format = "\%H:\%M:\%S", tz = "UTC") +} +\arguments{ +\item{format}{For \code{date_format()} and \code{time_format()} a date/time format +string using standard POSIX specification. See \code{\link[=strptime]{strptime()}} for details. + +For \code{date_short()} a character vector of length 4 giving the format +components to use for year, month, day, and hour respectively.} + +\item{tz}{a time zone name, see \code{\link[=timezones]{timezones()}}. Defaults +to UTC} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#superseded}{\figure{lifecycle-superseded.svg}{options: alt='[Superseded]'}}}{\strong{[Superseded]}} + +These functions are kept for backward compatibility; you should switch +to [label_date()/\code{\link[=label_time]{label_time()}} for new code. +} +\keyword{internal} diff --git a/man/dollar_format.Rd b/man/dollar_format.Rd new file mode 100644 index 00000000..c5548f6f --- /dev/null +++ b/man/dollar_format.Rd @@ -0,0 +1,82 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/label-dollar.R +\name{dollar_format} +\alias{dollar_format} +\alias{dollar} +\title{Superseded interface to \code{label_dollar()}} +\usage{ +dollar_format( + accuracy = NULL, + scale = 1, + prefix = "$", + suffix = "", + big.mark = ",", + decimal.mark = ".", + trim = TRUE, + largest_with_cents = 1e+05, + negative_parens = FALSE, + rescale_large = NULL, + ... +) + +dollar( + x, + accuracy = NULL, + scale = 1, + prefix = "$", + suffix = "", + big.mark = ",", + decimal.mark = ".", + trim = TRUE, + largest_with_cents = 1e+05, + negative_parens = FALSE, + rescale_large = NULL, + ... +) +} +\arguments{ +\item{accuracy}{Number to round to. If \code{NULL}, the default, +values will be rounded to the nearest integer, unless any of the +values has non-zero fractional component (e.g. cents) and the largest +value is less than \code{largest_with_cents} which by default is 100,000.} + +\item{scale}{A scaling factor: \code{x} will be multiplied by \code{scale} before +formatting. This is useful if the underlying data is very small or very +large.} + +\item{prefix}{Symbols to display before and after value.} + +\item{suffix}{Symbols to display before and after value.} + +\item{big.mark}{Character used between every 3 digits to separate thousands.} + +\item{decimal.mark}{The character to be used to indicate the numeric +decimal point.} + +\item{trim}{Logical, if \code{FALSE}, values are right-justified to a common +width (see \code{\link[base:format]{base::format()}}).} + +\item{largest_with_cents}{Number to round to. If \code{NULL}, the default, +values will be rounded to the nearest integer, unless any of the +values has non-zero fractional component (e.g. cents) and the largest +value is less than \code{largest_with_cents} which by default is 100,000.} + +\item{negative_parens}{Display negative using parentheses?} + +\item{rescale_large}{Named list indicating suffixes given to large values +(e.g. thousands, millions, billions, trillions). Name gives suffix, and +value specifies the power-of-ten. The two most common scales are provided +(\code{rescale_short_scale()} and \code{rescale_long_scale()}). +If \code{NULL}, the default, these suffixes aren't used.} + +\item{...}{Other arguments passed on to \code{\link[base:format]{base::format()}}.} + +\item{x}{A numeric vector} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#superseded}{\figure{lifecycle-superseded.svg}{options: alt='[Superseded]'}}}{\strong{[Superseded]}} + +These functions are kept for backward compatibility; you should switch +to \code{\link[=label_dollar]{label_dollar()}} for new code. +} +\keyword{internal} diff --git a/man/format_format.Rd b/man/format_format.Rd index c2ff6e8a..698b56e4 100644 --- a/man/format_format.Rd +++ b/man/format_format.Rd @@ -11,6 +11,7 @@ format_format(...) } \description{ \ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#superseded}{\figure{lifecycle-superseded.svg}{options: alt='[Superseded]'}}}{\strong{[Superseded]}} + This function is kept for backward compatiblity; you should either use \code{\link[=label_number]{label_number()}} or \code{\link[=label_date]{label_date()}} instead. } diff --git a/man/label_date.Rd b/man/label_date.Rd index 6f02bb55..810574d6 100644 --- a/man/label_date.Rd +++ b/man/label_date.Rd @@ -4,8 +4,6 @@ \alias{label_date} \alias{label_date_short} \alias{label_time} -\alias{date_format} -\alias{time_format} \title{Label date/times} \usage{ label_date(format = "\%Y-\%m-\%d", tz = "UTC") @@ -13,10 +11,6 @@ label_date(format = "\%Y-\%m-\%d", tz = "UTC") label_date_short(format = c("\%Y", "\%b", "\%d", "\%H:\%M"), sep = "\\n") label_time(format = "\%H:\%M:\%S", tz = "UTC") - -date_format(format = "\%Y-\%m-\%d", tz = "UTC") - -time_format(format = "\%H:\%M:\%S", tz = "UTC") } \arguments{ \item{format}{For \code{date_format()} and \code{time_format()} a date/time format @@ -49,12 +43,6 @@ but uses a slightly different approach: \code{ConciseDateFormatter} formats "firsts" (e.g. first day of month, first day of day) specially; \code{date_short()} formats changes (e.g. new month, new year) specially. } -\section{Old interface}{ - -\code{date_format()} and \code{time_format()} are superseded; please use \code{label_date()} -and \code{label_time()} instead. -} - \examples{ date_range <- function(start, days) { start <- as.POSIXct(start) diff --git a/man/label_dollar.Rd b/man/label_dollar.Rd index de93d533..67271559 100644 --- a/man/label_dollar.Rd +++ b/man/label_dollar.Rd @@ -2,8 +2,6 @@ % Please edit documentation in R/label-dollar.R \name{label_dollar} \alias{label_dollar} -\alias{dollar_format} -\alias{dollar} \alias{rescale_short_scale} \alias{rescale_long_scale} \title{Label currencies ($100, $2.50, etc)} @@ -22,35 +20,6 @@ label_dollar( ... ) -dollar_format( - accuracy = NULL, - scale = 1, - prefix = "$", - suffix = "", - big.mark = ",", - decimal.mark = ".", - trim = TRUE, - largest_with_cents = 1e+05, - negative_parens = FALSE, - rescale_large = NULL, - ... -) - -dollar( - x, - accuracy = NULL, - scale = 1, - prefix = "$", - suffix = "", - big.mark = ",", - decimal.mark = ".", - trim = TRUE, - largest_with_cents = 1e+05, - negative_parens = FALSE, - rescale_large = NULL, - ... -) - rescale_short_scale() rescale_long_scale() @@ -84,8 +53,6 @@ value specifies the power-of-ten. The two most common scales are provided If \code{NULL}, the default, these suffixes aren't used.} \item{...}{Other arguments passed on to \code{\link[base:format]{base::format()}}.} - -\item{x}{A numeric vector} } \value{ All \code{label_()} functions return a "labelling" function, i.e. a function that @@ -101,12 +68,6 @@ rather than axes. Format numbers as currency, rounding values to dollars or cents using a convenient heuristic. } -\section{Old interface}{ - -\code{dollar()} and \code{format_dollar()} are superseded; please use \code{label_dollar()} -instead. -} - \examples{ demo_continuous(c(0, 1), labels = label_dollar()) demo_continuous(c(1, 100), labels = label_dollar()) diff --git a/man/label_number.Rd b/man/label_number.Rd index 3155caa8..441c9de7 100644 --- a/man/label_number.Rd +++ b/man/label_number.Rd @@ -3,9 +3,6 @@ \name{label_number} \alias{label_number} \alias{label_comma} -\alias{comma} -\alias{number_format} -\alias{comma_format} \title{Label numbers in decimal format (e.g. 0.12, 1,234)} \usage{ label_number( @@ -30,42 +27,6 @@ label_comma( digits, ... ) - -comma( - x, - accuracy = NULL, - scale = 1, - prefix = "", - suffix = "", - big.mark = ",", - decimal.mark = ".", - trim = TRUE, - digits, - ... -) - -number_format( - accuracy = NULL, - scale = 1, - prefix = "", - suffix = "", - big.mark = " ", - decimal.mark = ".", - trim = TRUE, - ... -) - -comma_format( - accuracy = NULL, - scale = 1, - prefix = "", - suffix = "", - big.mark = ",", - decimal.mark = ".", - trim = TRUE, - digits, - ... -) } \arguments{ \item{accuracy}{A number to round to. Use (e.g.) \code{0.01} to show 2 decimal @@ -92,8 +53,6 @@ width (see \code{\link[base:format]{base::format()}}).} \item{...}{Other arguments passed on to \code{\link[base:format]{base::format()}}.} \item{digits}{Deprecated, use \code{accuracy} instead.} - -\item{x}{A numeric vector to format.} } \value{ All \code{label_()} functions return a "labelling" function, i.e. a function that @@ -110,12 +69,6 @@ Use \code{label_number()} force decimal display of numbers (i.e. don't use \link[=label_scientific]{scientific} notation). \code{label_comma()} is a special case that inserts a comma every three digits. } -\section{Old interface}{ - -\code{number_format()}, \code{comma_format()}, and \code{comma()} are superseded; please use -\code{label_number()} and \code{label_comma()} instead. -} - \examples{ demo_continuous(c(-1e6, 1e6)) demo_continuous(c(-1e6, 1e6), labels = label_number()) diff --git a/man/label_ordinal.Rd b/man/label_ordinal.Rd index 9069c28e..eb82bf23 100644 --- a/man/label_ordinal.Rd +++ b/man/label_ordinal.Rd @@ -5,8 +5,6 @@ \alias{ordinal_english} \alias{ordinal_french} \alias{ordinal_spanish} -\alias{ordinal_format} -\alias{ordinal} \title{Label ordinal numbers (1st, 2nd, 3rd, etc)} \usage{ label_ordinal( @@ -22,23 +20,6 @@ ordinal_english() ordinal_french(gender = c("masculin", "feminin"), plural = FALSE) ordinal_spanish() - -ordinal_format( - prefix = "", - suffix = "", - big.mark = " ", - rules = ordinal_english(), - ... -) - -ordinal( - x, - prefix = "", - suffix = "", - big.mark = " ", - rules = ordinal_english(), - ... -) } \arguments{ \item{prefix, suffix}{Symbols to display before and after value.} @@ -53,8 +34,6 @@ Name gives suffix, and value specifies which numbers to match.} \item{gender}{Masculin or feminin gender for French ordinal.} \item{plural}{Plural or singular for French ordinal.} - -\item{x}{A numeric vector to format.} } \value{ All \code{label_()} functions return a "labelling" function, i.e. a function that @@ -70,12 +49,6 @@ rather than axes. Round values to integers and then display as ordinal values (e.g. 1st, 2nd, 3rd). Built-in rules are provided for English, French, and Spanish. } -\section{Old interface}{ - -\code{ordinal()} and \code{format_ordinal()} are superseded; please use \code{label_ordinal()} -instead. -} - \examples{ demo_continuous(c(1, 5)) demo_continuous(c(1, 5), labels = label_ordinal()) diff --git a/man/label_parse.Rd b/man/label_parse.Rd index 003e1bb3..5636233c 100644 --- a/man/label_parse.Rd +++ b/man/label_parse.Rd @@ -3,17 +3,11 @@ \name{label_parse} \alias{label_parse} \alias{label_math} -\alias{parse_format} -\alias{math_format} \title{Label with mathematical annotations} \usage{ label_parse() label_math(expr = 10^.x, format = force) - -parse_format() - -math_format(expr = 10^.x, format = force) } \arguments{ \item{expr}{expression to use} @@ -37,12 +31,6 @@ rather than axes. \code{label_math()} constructs expressions by replacing the pronoun \code{.x} with each string. } -\section{Old interface}{ - -\code{parse_format()} and \code{math_format()} was superseded; please use -\code{label_parse()} and \code{label_math()} instead. -} - \examples{ # Use label_parse() with discrete scales greek <- c("alpha", "beta", "gamma") diff --git a/man/label_percent.Rd b/man/label_percent.Rd index ca99a1c7..c4fcd300 100644 --- a/man/label_percent.Rd +++ b/man/label_percent.Rd @@ -2,8 +2,6 @@ % Please edit documentation in R/label-percent.R \name{label_percent} \alias{label_percent} -\alias{percent_format} -\alias{percent} \title{Label percentages (2.5\%, 50\%, etc)} \usage{ label_percent( @@ -16,29 +14,6 @@ label_percent( trim = TRUE, ... ) - -percent_format( - accuracy = NULL, - scale = 100, - prefix = "", - suffix = "\%", - big.mark = " ", - decimal.mark = ".", - trim = TRUE, - ... -) - -percent( - x, - accuracy = NULL, - scale = 100, - prefix = "", - suffix = "\%", - big.mark = " ", - decimal.mark = ".", - trim = TRUE, - ... -) } \arguments{ \item{accuracy}{A number to round to. Use (e.g.) \code{0.01} to show 2 decimal @@ -65,8 +40,6 @@ decimal point.} width (see \code{\link[base:format]{base::format()}}).} \item{...}{Other arguments passed on to \code{\link[base:format]{base::format()}}.} - -\item{x}{A numeric vector to format.} } \value{ All \code{label_()} functions return a "labelling" function, i.e. a function that @@ -81,12 +54,6 @@ rather than axes. \description{ Label percentages (2.5\%, 50\%, etc) } -\section{Old interface}{ - -\code{percent()} and \code{percent_format()} are superseded; please use \code{label_percent()} -instead. -} - \examples{ demo_continuous(c(0, 1)) demo_continuous(c(0, 1), labels = label_percent()) diff --git a/man/label_pvalue.Rd b/man/label_pvalue.Rd index 6a51c5aa..1cff3fce 100644 --- a/man/label_pvalue.Rd +++ b/man/label_pvalue.Rd @@ -2,8 +2,6 @@ % Please edit documentation in R/label-pvalue.R \name{label_pvalue} \alias{label_pvalue} -\alias{pvalue_format} -\alias{pvalue} \title{Label p-values (e.g. <0.001, 0.25, p >= 0.99)} \usage{ label_pvalue( @@ -12,15 +10,6 @@ label_pvalue( prefix = NULL, add_p = FALSE ) - -pvalue_format( - accuracy = 0.001, - decimal.mark = ".", - prefix = NULL, - add_p = FALSE -) - -pvalue(x, accuracy = 0.001, decimal.mark = ".", prefix = NULL, add_p = FALSE) } \arguments{ \item{accuracy}{A number to round to. Use (e.g.) \code{0.01} to show 2 decimal @@ -38,8 +27,6 @@ put in front of numbers. The default values are \code{c("<", "", ">")} if \code{add_p} is \code{TRUE} and \code{c("p<", "p=", "p>")} if \code{FALSE}.} \item{add_p}{Add "p=" before the value?} - -\item{x}{A numeric vector to format.} } \value{ All \code{label_()} functions return a "labelling" function, i.e. a function that @@ -54,12 +41,6 @@ rather than axes. \description{ Formatter for p-values, using "<" and ">" for p-values close to 0 and 1. } -\section{Old interface}{ - -\code{pvalue()} and \code{pvalue_format()} are superseded; please use \code{label_pvalue()} -instead. -} - \examples{ demo_continuous(c(0, 1)) demo_continuous(c(0, 1), labels = label_pvalue()) diff --git a/man/label_scientific.Rd b/man/label_scientific.Rd index 5eab6ea1..0447c010 100644 --- a/man/label_scientific.Rd +++ b/man/label_scientific.Rd @@ -2,8 +2,6 @@ % Please edit documentation in R/label-scientific.R \name{label_scientific} \alias{label_scientific} -\alias{scientific_format} -\alias{scientific} \title{Label numbers with scientific notation (e.g. 1e05, 1.5e-02)} \usage{ label_scientific( @@ -15,27 +13,6 @@ label_scientific( trim = TRUE, ... ) - -scientific_format( - digits = 3, - scale = 1, - prefix = "", - suffix = "", - decimal.mark = ".", - trim = TRUE, - ... -) - -scientific( - x, - digits = 3, - scale = 1, - prefix = "", - suffix = "", - decimal.mark = ".", - trim = TRUE, - ... -) } \arguments{ \item{digits}{Number of digits to show before exponent.} @@ -53,8 +30,6 @@ decimal point.} width (see \code{\link[base:format]{base::format()}}).} \item{...}{Other arguments passed on to \code{\link[base:format]{base::format()}}.} - -\item{x}{A numeric vector to format.} } \value{ All \code{label_()} functions return a "labelling" function, i.e. a function that @@ -69,12 +44,6 @@ rather than axes. \description{ Label numbers with scientific notation (e.g. 1e05, 1.5e-02) } -\section{Old interface}{ - -\code{scientific_format()} and \code{scientific()} are superseded; please use -\code{label_scientific()}. -} - \examples{ demo_continuous(c(1, 10)) demo_continuous(c(1, 10), labels = label_scientific()) diff --git a/man/label_wrap.Rd b/man/label_wrap.Rd index 702a0179..94862292 100644 --- a/man/label_wrap.Rd +++ b/man/label_wrap.Rd @@ -2,12 +2,9 @@ % Please edit documentation in R/label-wrap.R \name{label_wrap} \alias{label_wrap} -\alias{wrap_format} \title{Label strings by wrapping across multiple lines} \usage{ label_wrap(width) - -wrap_format(width) } \arguments{ \item{width}{Number of characters per line.} @@ -25,11 +22,6 @@ rather than axes. \description{ Uses \code{\link[=strwrap]{strwrap()}} to split long labels across multiple lines. } -\section{Old interface}{ - -\code{wrap_format()} is superseded; please use \code{label_format()} instead. -} - \examples{ x <- c( "this is a long label", diff --git a/man/number.Rd b/man/number.Rd index cefbabd8..92e5c184 100644 --- a/man/number.Rd +++ b/man/number.Rd @@ -17,8 +17,6 @@ number( ) } \arguments{ -\item{x}{A numeric vector to format.} - \item{accuracy}{A number to round to. Use (e.g.) \code{0.01} to show 2 decimal places of precision. If \code{NULL}, the default, uses a heuristic that should ensure breaks have the minimum number of digits needed to show the diff --git a/man/number_bytes_format.Rd b/man/number_bytes_format.Rd index 32747e49..1ec447c4 100644 --- a/man/number_bytes_format.Rd +++ b/man/number_bytes_format.Rd @@ -19,6 +19,7 @@ variants for binary units.} } \description{ \ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#superseded}{\figure{lifecycle-superseded.svg}{options: alt='[Superseded]'}}}{\strong{[Superseded]}} + These functions are kept for backward compatibility, but you should switch to \code{\link[=label_bytes]{label_bytes()}} for new code. } diff --git a/man/ordinal_format.Rd b/man/ordinal_format.Rd new file mode 100644 index 00000000..b7e50350 --- /dev/null +++ b/man/ordinal_format.Rd @@ -0,0 +1,43 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/label-ordinal.R +\name{ordinal_format} +\alias{ordinal_format} +\alias{ordinal} +\title{Superseded interface to \code{label_ordinal()}} +\usage{ +ordinal_format( + prefix = "", + suffix = "", + big.mark = " ", + rules = ordinal_english(), + ... +) + +ordinal( + x, + prefix = "", + suffix = "", + big.mark = " ", + rules = ordinal_english(), + ... +) +} +\arguments{ +\item{prefix}{Symbols to display before and after value.} + +\item{suffix}{Symbols to display before and after value.} + +\item{big.mark}{Character used between every 3 digits to separate thousands.} + +\item{rules}{Named list of regular expressions, matched in order. +Name gives suffix, and value specifies which numbers to match.} + +\item{...}{Other arguments passed on to \code{\link[base:format]{base::format()}}.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#superseded}{\figure{lifecycle-superseded.svg}{options: alt='[Superseded]'}}}{\strong{[Superseded]}} + +These functions are kept for backward compatibility; you should switch +to \code{\link[=label_ordinal]{label_ordinal()}} for new code. +} +\keyword{internal} diff --git a/man/parse_format.Rd b/man/parse_format.Rd new file mode 100644 index 00000000..ad5c70c3 --- /dev/null +++ b/man/parse_format.Rd @@ -0,0 +1,25 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/label-expression.R +\name{parse_format} +\alias{parse_format} +\alias{math_format} +\title{Superseded interface to \code{label_parse()}/\code{label_math()}} +\usage{ +parse_format() + +math_format(expr = 10^.x, format = force) +} +\arguments{ +\item{expr}{expression to use} + +\item{format}{another format function to apply prior to mathematical +transformation - this makes it easier to use floating point numbers in +mathematical expressions.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#superseded}{\figure{lifecycle-superseded.svg}{options: alt='[Superseded]'}}}{\strong{[Superseded]}} + +These functions are kept for backward compatibility; you should switch +to \code{\link[=label_parse]{label_parse()}}/\code{\link[=label_math]{label_math()}} for new code. +} +\keyword{internal} diff --git a/man/percent_format.Rd b/man/percent_format.Rd new file mode 100644 index 00000000..536dc132 --- /dev/null +++ b/man/percent_format.Rd @@ -0,0 +1,63 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/label-percent.R +\name{percent_format} +\alias{percent_format} +\alias{percent} +\title{Superseded interface to \code{label_percent()}} +\usage{ +percent_format( + accuracy = NULL, + scale = 100, + prefix = "", + suffix = "\%", + big.mark = " ", + decimal.mark = ".", + trim = TRUE, + ... +) + +percent( + x, + accuracy = NULL, + scale = 100, + prefix = "", + suffix = "\%", + big.mark = " ", + decimal.mark = ".", + trim = TRUE, + ... +) +} +\arguments{ +\item{accuracy}{A number to round to. Use (e.g.) \code{0.01} to show 2 decimal +places of precision. If \code{NULL}, the default, uses a heuristic that should +ensure breaks have the minimum number of digits needed to show the +difference between adjacent values. + +Applied to rescaled data.} + +\item{scale}{A scaling factor: \code{x} will be multiplied by \code{scale} before +formatting. This is useful if the underlying data is very small or very +large.} + +\item{prefix}{Symbols to display before and after value.} + +\item{suffix}{Symbols to display before and after value.} + +\item{big.mark}{Character used between every 3 digits to separate thousands.} + +\item{decimal.mark}{The character to be used to indicate the numeric +decimal point.} + +\item{trim}{Logical, if \code{FALSE}, values are right-justified to a common +width (see \code{\link[base:format]{base::format()}}).} + +\item{...}{Other arguments passed on to \code{\link[base:format]{base::format()}}.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#superseded}{\figure{lifecycle-superseded.svg}{options: alt='[Superseded]'}}}{\strong{[Superseded]}} + +These functions are kept for backward compatibility; you should switch +to \code{\link[=label_percent]{label_percent()}} for new code. +} +\keyword{internal} diff --git a/man/pretty_breaks.Rd b/man/pretty_breaks.Rd new file mode 100644 index 00000000..f617a2d0 --- /dev/null +++ b/man/pretty_breaks.Rd @@ -0,0 +1,21 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/breaks.r +\name{pretty_breaks} +\alias{pretty_breaks} +\title{Superseded interface to \code{breaks_pretty()}} +\usage{ +pretty_breaks(n = 5, ...) +} +\arguments{ +\item{n}{Desired number of breaks. You may get slightly more or fewer +breaks that requested.} + +\item{...}{other arguments passed on to \code{\link[=pretty]{pretty()}}} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#superseded}{\figure{lifecycle-superseded.svg}{options: alt='[Superseded]'}}}{\strong{[Superseded]}} + +These functions are kept for backward compatibility; you should switch +to \code{\link[=breaks_pretty]{breaks_pretty()}} for new code. +} +\keyword{internal} diff --git a/man/pvalue_format.Rd b/man/pvalue_format.Rd new file mode 100644 index 00000000..71e4436a --- /dev/null +++ b/man/pvalue_format.Rd @@ -0,0 +1,40 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/label-pvalue.R +\name{pvalue_format} +\alias{pvalue_format} +\alias{pvalue} +\title{Superseded interface to \code{label_pvalue()}} +\usage{ +pvalue_format( + accuracy = 0.001, + decimal.mark = ".", + prefix = NULL, + add_p = FALSE +) + +pvalue(x, accuracy = 0.001, decimal.mark = ".", prefix = NULL, add_p = FALSE) +} +\arguments{ +\item{accuracy}{A number to round to. Use (e.g.) \code{0.01} to show 2 decimal +places of precision. If \code{NULL}, the default, uses a heuristic that should +ensure breaks have the minimum number of digits needed to show the +difference between adjacent values. + +Applied to rescaled data.} + +\item{decimal.mark}{The character to be used to indicate the numeric +decimal point.} + +\item{prefix}{A character vector of length 3 giving the prefixes to +put in front of numbers. The default values are \code{c("<", "", ">")} +if \code{add_p} is \code{TRUE} and \code{c("p<", "p=", "p>")} if \code{FALSE}.} + +\item{add_p}{Add "p=" before the value?} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#superseded}{\figure{lifecycle-superseded.svg}{options: alt='[Superseded]'}}}{\strong{[Superseded]}} + +These functions are kept for backward compatibility; you should switch +to \code{\link[=label_pvalue]{label_pvalue()}} for new code. +} +\keyword{internal} diff --git a/man/scientific_format.Rd b/man/scientific_format.Rd new file mode 100644 index 00000000..c8249e5d --- /dev/null +++ b/man/scientific_format.Rd @@ -0,0 +1,54 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/label-scientific.R +\name{scientific_format} +\alias{scientific_format} +\alias{scientific} +\title{Superseded interface to \code{label_scientific()}} +\usage{ +scientific_format( + digits = 3, + scale = 1, + prefix = "", + suffix = "", + decimal.mark = ".", + trim = TRUE, + ... +) + +scientific( + x, + digits = 3, + scale = 1, + prefix = "", + suffix = "", + decimal.mark = ".", + trim = TRUE, + ... +) +} +\arguments{ +\item{digits}{Number of digits to show before exponent.} + +\item{scale}{A scaling factor: \code{x} will be multiplied by \code{scale} before +formatting. This is useful if the underlying data is very small or very +large.} + +\item{prefix}{Symbols to display before and after value.} + +\item{suffix}{Symbols to display before and after value.} + +\item{decimal.mark}{The character to be used to indicate the numeric +decimal point.} + +\item{trim}{Logical, if \code{FALSE}, values are right-justified to a common +width (see \code{\link[base:format]{base::format()}}).} + +\item{...}{Other arguments passed on to \code{\link[base:format]{base::format()}}.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#superseded}{\figure{lifecycle-superseded.svg}{options: alt='[Superseded]'}}}{\strong{[Superseded]}} + +These functions are kept for backward compatibility; you should switch +to \code{\link[=label_scientific]{label_scientific()}} for new code. +} +\keyword{internal} diff --git a/man/trans_breaks.Rd b/man/trans_breaks.Rd index db321f4c..dd108bf3 100644 --- a/man/trans_breaks.Rd +++ b/man/trans_breaks.Rd @@ -18,6 +18,7 @@ vector returns the transformed values} } \description{ \ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#superseded}{\figure{lifecycle-superseded.svg}{options: alt='[Superseded]'}}}{\strong{[Superseded]}} + These often do not produce very attractive breaks. } \examples{ diff --git a/man/unit_format.Rd b/man/unit_format.Rd index 377ffd36..82ff3f0b 100644 --- a/man/unit_format.Rd +++ b/man/unit_format.Rd @@ -49,6 +49,7 @@ width (see \code{\link[base:format]{base::format()}}).} } \description{ \ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#superseded}{\figure{lifecycle-superseded.svg}{options: alt='[Superseded]'}}}{\strong{[Superseded]}} + This function is kept for backward compatiblity; you should either use \code{\link[=label_number]{label_number()}} or \code{\link[=label_number_si]{label_number_si()}} instead. } diff --git a/man/wrap_format.Rd b/man/wrap_format.Rd new file mode 100644 index 00000000..108bad29 --- /dev/null +++ b/man/wrap_format.Rd @@ -0,0 +1,18 @@ +% Generated by roxygen2: do not edit by hand +% Please edit documentation in R/label-wrap.R +\name{wrap_format} +\alias{wrap_format} +\title{Superseded interface to \code{label_wrap()}} +\usage{ +wrap_format(width) +} +\arguments{ +\item{width}{Number of characters per line.} +} +\description{ +\ifelse{html}{\href{https://lifecycle.r-lib.org/articles/stages.html#superseded}{\figure{lifecycle-superseded.svg}{options: alt='[Superseded]'}}}{\strong{[Superseded]}} + +These functions are kept for backward compatibility; you should switch +to \code{\link[=label_wrap]{label_wrap()}} for new code. +} +\keyword{internal}