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