quantity_index | R Documentation |
Remaps price arguments into quantity argument (and vice versa) to turn a price index into a quantity index.
quantity_index(f)
f |
A price-index function. |
A function like f
, except that the role of prices/quantities is reversed.
Other operators:
balanced()
,
grouped()
p1 <- price6[[3]]
p0 <- price6[[2]]
q1 <- quantity6[[3]]
q0 <- quantity6[[2]]
# Remap argument names to be quantities rather than prices
quantity_index(laspeyres_index)(q1 = q1, q0 = q0, p0 = p0)
laspeyres_index(p1 = q1, p0 = q0, q0 = p0)
# Works with the index_weights() functions, too
quantity_index(index_weights("Laspeyres"))(q0 = q0, p0 = p0)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.