From 5f6ff3694561c07426bdf33ba2cb8412f25b93d1 Mon Sep 17 00:00:00 2001 From: Richard Iannone Date: Tue, 30 Apr 2024 09:08:33 -0400 Subject: [PATCH] Update help files using roxygen --- man/fmt_chem.Rd | 6 +++--- man/fmt_spelled_num.Rd | 43 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 46 insertions(+), 3 deletions(-) diff --git a/man/fmt_chem.Rd b/man/fmt_chem.Rd index 98fd046647..71707b567d 100644 --- a/man/fmt_chem.Rd +++ b/man/fmt_chem.Rd @@ -110,13 +110,13 @@ incantations could be used: \code{"CrO4^2-"}, \code{"Fe^n+"}, \code{"Y^99+"}, \c automatically stylized to fit conventions; \code{"NO_x"} and \code{"x Na(NH4)HPO4"} will have italicized 'x' characters and you can always italicize letters by surrounding with \code{"*"} (as in \code{"*n* H2O"} or \code{"*n*-C5H12"}) -\item Chemical isotopes can be rendered using either of these two construction +\item Chemical isotopes can be rendered using either of these two constructions preceding an element: \code{"^{227}_{90}Th"} or \code{"^227_90Th"}; nuclides can be represented in a similar manner, here are two examples: \code{"^{0}_{-1}n^{-}"}, \code{"^0_-1n-"} \item Chemical reactions can use \code{"+"} signs and a variety of reaction arrows: -(1) "A -> B", (2) "A <- B", (3) "A <-> B", (4) "A <--> B", (5) "A <=> B", -(6) "A <=>> B", or (7) "A <<=> B" +(1) \code{"A -> B"}, (2) \code{"A <- B"}, (3) \code{"A <-> B"}, (4) \code{"A <--> B"}, (5) +\code{"A <=> B"}, (6) \code{"A <=>> B"}, or (7) \code{"A <<=> B"} \item Center dots (useful in addition compounds) can be added by using a single \code{"."} or \code{"*"} character, surrounded by spaces; here are two equivalent examples \code{"KCr(SO4)2 . 12 H2O"} and \code{"KCr(SO4)2 * 12 H2O"} diff --git a/man/fmt_spelled_num.Rd b/man/fmt_spelled_num.Rd index c108932c76..1de384329c 100644 --- a/man/fmt_spelled_num.Rd +++ b/man/fmt_spelled_num.Rd @@ -244,6 +244,49 @@ the word 'Number' in front of every spelled-out number. \if{html}{\out{ This image of a table was generated from the second code example in the `fmt_spelled_num()` help file. }} + +Let's make a table that compares how the numbers from \code{1} to \code{10} are spelled +across a small selection of languages. Here we use \code{fmt_spelled_num()} with +each column, ensuring that the \code{locale} value matches that of the column +name. + +\if{html}{\out{
}}\preformatted{dplyr::tibble( + num = 1:10, + en = num, + fr = num, + de = num, + es = num, + pl = num, + bg = num, + ko = num, + zh = num +) |> + gt(rowname_col = "num") |> + fmt_spelled_num(columns = en, locale = "en") |> + fmt_spelled_num(columns = fr, locale = "fr") |> + fmt_spelled_num(columns = de, locale = "de") |> + fmt_spelled_num(columns = es, locale = "es") |> + fmt_spelled_num(columns = pl, locale = "pl") |> + fmt_spelled_num(columns = bg, locale = "bg") |> + fmt_spelled_num(columns = ko, locale = "ko") |> + fmt_spelled_num(columns = zh, locale = "zh") |> + cols_label_with(fn = function(x) md(paste0("`", x, "`"))) |> + tab_spanner( + label = "Numbers in the specified locale", + columns = everything() + ) |> + cols_align(align = "left", columns = everything()) |> + cols_width( + c(en, fr, de, es, pl, bg) ~ px(100), + c(ko, zh) ~ px(50) + ) |> + opt_horizontal_padding(scale = 2) |> + opt_vertical_padding(scale = 0.5) +}\if{html}{\out{
}} + +\if{html}{\out{ +This image of a table was generated from the third code example in the `fmt_spelled_num()` help file. +}} } \section{Function ID}{