Skip to contents

S3 method for printing objects with a "Unit" class. Displays the value along with its associated unit.

Usage

# S3 method for class 'Unit'
print(x, ...)

Arguments

x

an object with class "Unit".

...

additional arguments passed to print().

Value

Invisibly returns x.

Examples

x <- 10
unit(x) <- "m"
class(x) <- "Unit"
print(x)
#> 10 [ m ]