normalization {debkeepr}R Documentation

Normalize tripartite and tetrapartite values

Description

Normalize tripartite and tetrapartite values values to given bases.

Usage

deb_normalize(x, ...)

## Default S3 method:
deb_normalize(x, ...)

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

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

## S3 method for class '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 is c(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_normalize(x_alt)

# 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_normalize(t_alt)

# Normalize a numeric vector of length 3
deb_normalize(c(12, 93, 78))
deb_normalize(c(12, 93, 78), bases = c(60, 16))

# 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_normalize(c(12, 93, 78, 42), bases = c(60, 16, 8))


[Package debkeepr version 0.1.1 Index]