Skip to contents

Inserts a Unicode character by its numeric codepoint. At render time the backend converts to the appropriate escape sequence (RTF \uN or LaTeX command). Use this for symbols not available on the keyboard or for cross-platform portability.

For the most commonly used symbols in clinical tables, prefer the dedicated helpers: fr_dagger(), fr_ddagger().

Usage

fr_unicode(codepoint)

Arguments

codepoint

Integer. Unicode codepoint in hex (e.g. 0x00B1 for ±) or decimal (e.g. 177L). Must be a single value.

Value

An fr_markup object containing the UTF-8 character.

Common codepoints for clinical tables

SymbolHexDescription
±0x00B1Plus-minus (lab ranges)
0x2264Less-than-or-equal
0x2265Greater-than-or-equal
×0x00D7Multiplication (dosing)
°0x00B0Degree (temperature)
α0x03B1Alpha (significance level)
β0x03B2Beta (type II error)
μ0x03BCMu (mean)
0x2020Dagger (use fr_dagger())
0x2021Double dagger (use fr_ddagger())

See also

fr_dagger() and fr_ddagger() for common symbol shortcuts, fr_super() for superscript notation.

Examples

# Plus-minus symbol in a label
fr_col("Mean {fr_unicode(0x00B1)} SD", width = 1.5)
#> <fr_col> "Mean {fr_unicode(0x00B1)} SD" [1.50in, left]

# Degree symbol
fr_col("Temperature ({fr_unicode(0x00B0)}C)", width = 1.5)
#> <fr_col> "Temperature ({fr_unicode(0x00B0)}C)" [1.50in, left]

# In a footnote:
spec <- tbl_demog |> fr_table()
spec |> fr_footnotes("[a] P {fr_unicode(0x2264)} 0.05 considered significant.")
#> 
#> ── fr_spec: Table 
#> Data: 28 rows x 6 columns
#> Page: landscape letter, 9pt Courier New
#> Header: valign=bottom
#> Footnotes (1):
#> 1. [left] "[a] P ≤ 0.05 considered significant."