Normalize tripartite and tetrapartite values values to given bases.
Usage
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), ...)
# S3 method for deb_tetra
deb_normalize(x, ...)
Arguments
- x
Either an vector of class
deb_lsd
,deb_tetra
, or a numeric vector of length 3 or 4 representing the values to be normalized.- ...
Arguments passed on to further methods.
- bases
Used only if
x
is a numeric vector. A Numeric vector of length 2 or 3 used to specify the bases for the solidus or s, denarius or d, and optionally the farthing or f units. Default isc(20, 12)
, which conforms to the most widely used system of 1 pound = 20 shillings and 1 shilling = 12 pence.
Value
Returns a vector of class deb_lsd
with normalized solidus and
denarius units or a vector of class deb_tetra
with normalized solidus,
denarius, and farthing units.
Examples
# Normalize a deb_lsd vector
x <- deb_lsd(12, 93, 78)
x_alt <- deb_lsd(12, 93, 78, bases = c(60, 16))
deb_normalize(x)
#> <deb_lsd[1]>
#> [1] 16:19s:6d
#> # Bases: 20s 12d
deb_normalize(x_alt)
#> <deb_lsd[1]>
#> [1] 13:37s:14d
#> # Bases: 60s 16d
# Normalize a deb_tetra vector
t <- deb_tetra(12, 83, 78, 42)
t_alt <- deb_tetra(12, 83, 78, 42, bases = c(60, 16, 8))
deb_normalize(t)
#> <deb_tetra[1]>
#> [1] 16:10s:4d:2f
#> # Bases: 20s 12d 4f
deb_normalize(t_alt)
#> <deb_tetra[1]>
#> [1] 13:28s:3d:2f
#> # Bases: 60s 16d 8f
# Normalize a numeric vector of length 3
deb_normalize(c(12, 93, 78))
#> <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
# Normalize a numeric vector of length 4
# Must provide bases of length 3
deb_normalize(c(12, 93, 78, 42), bases = c(20, 12, 4))
#> <deb_tetra[1]>
#> [1] 17:0s:4d:2f
#> # Bases: 20s 12d 4f
deb_normalize(c(12, 93, 78, 42), bases = c(60, 16, 8))
#> <deb_tetra[1]>
#> [1] 13:38s:3d:2f
#> # Bases: 60s 16d 8f