Create a vector of classdeb_tetra
to integrate values with four unitsinto standardized forms of analysis provided by R.
Arguments
- l
Numeric vector representing the pounds unit.
- s
Numeric vector representing the shillings unit.
- d
Numeric vector representing the pence unit.
- f
Numeric vector representing the farthing or fourth unit.
- bases
Numeric vector of length 3 used to specify the bases for thesolidus or s, denarius or d, and farthing or f units. Default is
c(20, 12, 4)
, which conforms to the English system of 1 pound =20 shillings, 1 shilling = 12 pence, and 1 pence = 4 farthing.
Details
Thedeb_tetra
class extends the concept of thedeb_lsd
class toincorporate currencies and other types of values that consist of four units.A variety of currencies and measurements of weights expanded beyond theconventional tripartite system of pounds, shillings, and pence to include afourth unit.deb_tetra
adds a fourth unit, namedf
for farthing, to thel, s, and d units used bydeb_lsd
.Thebases
attribute ofdeb_tetra
vectors makes it possible to specifyalternative bases for thesolidus,denarius, and farthing units.
The length ofl
,s
,d
, andf
must either be all equal, or a vector oflength 1 can be recycled to the length of the other argument(s). Seethevctrs packagefor further details on recycling vectors. In addition,l
,s
,d
, andf
must either all have no values, resulting in a vector of length 0, or allpossess numeric vectors.
See also
Thedeb_tetra
class works in concert with thedeb_decimal
class,which can represent tetrapartite values as decimalized values. Seedeb_decimal()
. To represent values with tripartite units seedeb_lsd()
.
Examples
deb_tetra(5,3,8,2)#> <deb_tetra[1]>#> [1] 5:3s:8d:2f#> # Bases: 20s 12d 4fdeb_tetra(l=c(10,8,5), s=c(6,13,8), d=c(8,4,10), f=c(2,3,1))#> <deb_tetra[3]>#> [1] 10:6s:8d:2f 8:13s:4d:3f 5:8s:10d:1f#> # Bases: 20s 12d 4f# Recycle length 1 vectordeb_tetra(l=c(10,8,5), s=c(6,13,8), d=c(8,4,10), f=2)#> <deb_tetra[3]>#> [1] 10:6s:8d:2f 8:13s:4d:2f 5:8s:10d:2f#> # Bases: 20s 12d 4f# Set the bases of the deb_tetra vectordeb_tetra(5,3,8,2, bases=c(60,16,8))#> <deb_tetra[1]>#> [1] 5:3s:8d:2f#> # Bases: 60s 16d 8fdeb_tetra(l=c(10,28,5), s=c(6,33,13), d=c(8,12,10), f=c(5,3,6), bases=c(60,16,8))#> <deb_tetra[3]>#> [1] 10:6s:8d:5f 28:33s:12d:3f 5:13s:10d:6f#> # Bases: 60s 16d 8f# Create a prototype or vector of length 0deb_tetra()#> <deb_tetra[0]>#> # Bases: 20s 12d 4f