library(ggplot2)
cpieth[["ethdt"]] <- eth_date(cpieth$date)
ggplot(cpieth, aes(ethdt, cpi)) +
geom_line() +
scale_x_ethdate(breaks = eth_breaks(6),
labels = eth_labels("%Y"),
name = "Year (EC)") +
theme_bw()
Run the code above in your browser using DataLab