set-css-latex-units: Set CSS/LaTeX units

Description Usage Arguments Value Examples

Description

These functions check that units are legitimate CSS/LaTeX units, then call units::set_units().

Usage

1
2
3
4
5
6
7
set_css_units(x, value, ..., mode = units_options("set_units_mode"))

set_latex_units(x, value, ..., mode = units_options("set_units_mode"))

css_units(x) <- value

latex_units(x) <- value

Arguments

x, value, ..., mode

See units::set_units()

Value

An object of class units. Throws an error if the unit specification is not recognized.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
unloadNamespace("cssunits")
unloadNamespace("units")
library(cssunits)

install_css_units()
set_css_units(1, "px", mode = "standard")
set_css_units(1, px)
# catching errors:
try(set_css_units(1, pox))

x <- 1:3
css_units(x) <- "px"
x

hughjonesd/cssunits documentation built on May 18, 2020, 12:56 p.m.