CPI 与 R 的通货膨胀率



我必须创建20年(1990-2010(的通货膨胀率。我现在有一个简历文件,其中包含这 20 年中每个月的 CPI 率。现在如何轻松地创建 R 中的通货膨胀率?

感谢您的帮助!

编辑:

infl <- cpi[13:n]/cpi[1:(n-12)]
n <- length(cpi)```
i got this help from my teacher, how can I use this code?
[My File][1]

[1]: https://i.stack.imgur.com/CYaBN.png

你可以参考已经这样做blscrapeR包。

这也是它的小插图,告诉你如何使用它:

https://cran.r-project.org/web/packages/blscrapeR/vignettes/Inflation_and_Prices.html

最新更新