Function that actually performs the normalization of lsd value

Normalize pounds, shillings, and pence values to given bases of solidus and denarius units.

normalize(l, s, d, bases)

deb_normalize(x, ...)

# S3 method for default
deb_normalize(x, ...)

# S3 method for deb_lsd
deb_normalize(x, ...)

# S3 method for numeric
deb_normalize(x, bases = c(20, 12), ...)

Arguments

bases

Used only if x is a numeric vector. A Numeric vector of length 2 used to specify the bases for the shillings or s and pence or d units. Default is c(20, 12), which conforms to the most widely used system of 1 pound = 20 shillings and 1 shilling = 12 pence.

x

Either an vector of class deb_lsd or a numeric vector of length 3 representing the values to be normalized.

...

Arguments passed on to further methods.

Value

Returns a vector of class deb_lsd with normalized solidus and denarius units.

Examples

# Normalize a deb_lsd vector x <- deb_lsd(12, 93, 78) y <- deb_lsd(12, 93, 78, bases = c(60, 16)) deb_normalize(x)
#> <deb_lsd[1]> #> [1] 16:19s:6d #> # Bases: 20s 12d
#> <deb_lsd[1]> #> [1] 13:37s:14d #> # Bases: 60s 16d
# Normalize a numeric vector of length 3 deb_normalize(c(12, 93, 78), bases = c(20, 12))
#> <deb_lsd[1]> #> [1] 16:19s:6d #> # Bases: 20s 12d
deb_normalize(c(12, 93, 78), bases = c(60, 16))
#> <deb_lsd[1]> #> [1] 13:37s:14d #> # Bases: 60s 16d