try_install_unit: try_install_unit

try_install_unitR Documentation

try_install_unit

Description

Just like units::install_unit(), except that it does nothing if you try to "re-install" an existing unit. (Unless you pass verbose = TRUE, in which case it will just output a message to that effect.)

Usage

try_install_unit(
  symbol = character(0),
  def = character(0),
  name = character(0),
  verbose = FALSE
)

Arguments

...

passed to units::install_unit()

Note

The units package used to support install_symbolic_unit(..., warn = TRUE). With that syntax, attempting to install an already-installed unit just led to a warning; it didn't throw an error. There doesn't seem to be a function offered by units to check whether a symbolic unit is already installed. If there were, that would seem to be more preferable.


BAAQMD/unittools documentation built on Jan. 28, 2024, 9:14 p.m.