
Remaps price arguments into quantity argument (and vice versa) to turn a price index into a quantity index.
quantity_index(f)
A function like f
, except that the role of prices/quantities is reversed.
A price-index function.
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)
Run the code above in your browser using DataLab