deb_lsd {debkeepr} | R Documentation |
A class for pounds, shillings and pence values
Description
Create a vector of class deb_lsd
to integrate non-decimal currencies
into standardized forms of analysis provided by R.
Usage
deb_lsd(l = double(), s = double(), d = double(), bases = c(20, 12))
Arguments
l |
Numeric vector representing the pounds unit. |
s |
Numeric vector representing the shillings unit. |
d |
Numeric vector representing the pence unit. |
bases |
Numeric vector of length 2 used to specify the bases for the
solidus or s and denarius or d units. Default is |
Details
The deb_decimal
class and the debkeepr
package use the nomenclature of
l, s, and d to represent the tripartite
system of pounds, shillings, and pence units. The abbreviations derive from
the Latin terms libra,
solidus, and
denarius. In the 8th century a
solidus came to represent 12 denarii coins, and, for a time at least,
240 denarii were made from one libra or pound of silver. The custom of
counting coins in dozens (solidi) and scores of dozens (librae) spread
throughout the Carolingian Empire and became ingrained in much of Europe.
However, a variety of accounting systems arose at different times that used
other bases for the
solidus and denarius units. The bases
attribute of deb_decimal
vectors makes it possible to specify alternative bases for the solidus and
denarius units.
The length of l
, s
, and d
must either be all equal, or a vector of
length 1 can be recycled to the length of the other argument(s). See
the vctrs package
for further details on recycling vectors. In addition, l
, s
, and d
must either all have no values, resulting in a vector of length 0, or all
possess numeric vectors.
Value
Returns a vector of class deb_lsd
.
See Also
The deb_lsd
class works in concert with the deb_decimal
class, which
represents non-decimal currencies as decimalized values. See
deb_decimal()
. To represent values with tetrapartite units see
deb_tetra()
.
Examples
deb_lsd(5, 3, 8)
deb_lsd(l = c(10, 8, 5),
s = c(6, 13, 8),
d = c(8, 4, 10))
# Recycle length 1 vector
deb_lsd(l = c(10, 8, 5),
s = c(6, 13, 8),
d = 0)
# Set the bases of the deb_lsd vector
deb_lsd(5, 3, 8, bases = c(60, 16))
deb_lsd(l = c(10, 28, 5),
s = c(6, 33, 13),
d = c(8, 42, 10),
bases = c(60, 16))
# Create a prototype or vector of length 0
deb_lsd()