define_units {gt}R Documentation

Define measurement units with gt's units notation

Description

The define_units() function is available for working with text in gt's units notation.

Usage

define_units(units_notation)

Arguments

units_notation

Text in specialized units notation

⁠scalar<character>⁠ // required

A single string that defines the units (e.g., "m/s") to be used.

Value

An object of class units_definition.

How to use gt's units notation

The units notation involves a shorthand of writing units that feels familiar and is fine-tuned for the task at hand. Each unit is treated as a separate entity (parentheses and other symbols included) and the addition of subscript text and exponents is flexible and relatively easy to formulate. This is all best shown with examples:

Function ID

8-9

Function Introduced

v0.10.0 (October 7, 2023)

See Also

Other helper functions: adjust_luminance(), cell_borders(), cell_fill(), cell_text(), cells_body(), cells_column_labels(), cells_column_spanners(), cells_footnotes(), cells_grand_summary(), cells_row_groups(), cells_source_notes(), cells_stub_grand_summary(), cells_stub_summary(), cells_stubhead(), cells_stub(), cells_summary(), cells_title(), currency(), default_fonts(), escape_latex(), from_column(), google_font(), gt_latex_dependencies(), html(), md(), nanoplot_options(), pct(), px(), random_id(), stub(), system_fonts()


[Package gt version 0.10.1 Index]