| 1 |
% Generated by roxygen2: do not edit by hand |
| 2 |
% Please edit documentation in R/sigfig.R, R/styles.R |
| 3 |
\name{style_num} |
| 4 |
\alias{style_num} |
| 5 |
\alias{style_subtle} |
| 6 |
\alias{style_subtle_num} |
| 7 |
\alias{style_bold} |
| 8 |
\alias{style_na} |
| 9 |
\alias{style_neg} |
| 10 |
\title{Styling helpers} |
| 11 |
\usage{ |
| 12 |
style_num(x, negative, significant = rep_along(x, TRUE)) |
| 13 |
|
| 14 |
style_subtle(x) |
| 15 |
|
| 16 |
style_subtle_num(x, negative) |
| 17 |
|
| 18 |
style_bold(x) |
| 19 |
|
| 20 |
style_na(x) |
| 21 |
|
| 22 |
style_neg(x) |
| 23 |
} |
| 24 |
\arguments{ |
| 25 |
\item{x}{The character vector to style.} |
| 26 |
|
| 27 |
\item{negative, significant}{Logical vector the same length as \code{x} that |
| 28 |
indicate if the values are negative and significant, respectively} |
| 29 |
} |
| 30 |
\description{ |
| 31 |
Functions that allow implementers of formatters for custom data types to |
| 32 |
maintain a consistent style with the default data types. |
| 33 |
} |
| 34 |
\details{ |
| 35 |
\code{style_subtle()} is affected by the \code{subtle} \link[=pillar_options]{option}. |
| 36 |
|
| 37 |
\code{style_subtle_num()} is affected by the |
| 38 |
\code{subtle_num} \link[=pillar_options]{option}, |
| 39 |
which is \code{FALSE} by default. |
| 40 |
|
| 41 |
\code{style_bold()} is affected by the \code{bold} \link[=pillar_options]{option}, |
| 42 |
which is \code{FALSE} by default. |
| 43 |
|
| 44 |
\code{style_neg()} is affected by the \code{pillar.neg} \link[=pillar_options]{option}. |
| 45 |
} |
| 46 |
\examples{ |
| 47 |
style_num( |
| 48 |
c("123", "456"), |
| 49 |
negative = c(TRUE, FALSE) |
| 50 |
) |
| 51 |
style_num( |
| 52 |
c("123", "456"), |
| 53 |
negative = c(TRUE, FALSE), |
| 54 |
significant = c(FALSE, FALSE) |
| 55 |
) |
| 56 |
style_subtle("text") |
| 57 |
style_subtle_num(0.01 * 1:3, c(TRUE, FALSE, TRUE)) |
| 58 |
style_bold("Petal.Width") |
| 59 |
style_na("NA") |
| 60 |
style_neg("123") |
| 61 |
} |
| 62 |
\seealso{ |
| 63 |
\link{pillar_options} for a list of options |
| 64 |
} |