Punits: Prepare units for Printing and Plotting

View source: R/Punits.r

PunitsR Documentation

Prepare units for Printing and Plotting

Description

Takes a character variable containing units of measurement for a variable. If it has zero length, a "" string is return. Otherwise, any trailing "s" is removed if the string is longer than one character, and depending on the arguments, the string is changed to lower case, "s" is added, and the first character is changed to upper case.

Usage

Punits(u, lower = TRUE, adds = TRUE, upfirst = FALSE, default = "")

Arguments

u

a single string containing units of measurement

lower

if TRUE set string to all lower case

adds

if TRUE add trailing "s"

upfirst

if TRUE set first character to upper case

default

default units if u is empty

Value

a single character string

See Also

Hmisc::units()

Examples

## Not run: 
Punits('Years')

## End(Not run)

rms documentation built on April 12, 2025, 1:18 a.m.

Related to Punits in rms...