New Zealand · R

What is orange and been in the news

Carrot prices

Looking at both the raw (so to speak) and seasonally adjusted figures, it looks to me like carrots, as the most extreme difference, got a discussion in the press release, but there is more of a steady upward creep in prices generally. The released figures go to the Fruit and Vegetable level, and no more detail beyond that.

And the code:

download.file("", destfile="foodpriceindex.xlsx", mode="wb")
fuit_veg_raw <- read_excel("foodpriceindex.xlsx", sheet = "1", col_names = FALSE, skip = 11)
fuit_veg_seas_adjust <- read_excel("foodpriceindex.xlsx", sheet = "8", col_names = FALSE, skip = 10)
fuit_veg_raw <- fill(fuit_veg_raw, X0)[1:37,1:3]
fuit_veg_seas_adjust <- fill(fuit_veg_seas_adjust, X0)[1:37,1:3]
fuit_veg_raw$data_date <- seq.Date(from=as.Date("2014-02-01"),
fuit_veg_seas_adjust$data_date <- seq.Date(from=as.Date("2014-02-01"), 
plot(fuit_veg_raw$data_date, fuit_veg_raw$X2, type="l", ylim=c(1000,1400), main="fruit & veg",
 frame.plot=FALSE, xlab="Date (Feb marked in orange)", ylab="indexed prices")
points(fuit_veg_raw$data_date[fuit_veg_raw$X1=="Feb"], fuit_veg_raw$X2[fuit_veg_raw$X1=="Feb"],
 pch=19, col="orange", cex=0.6)
lines(fuit_veg_seas_adjust$data_date, fuit_veg_seas_adjust$X2, lty=2, col="#00009999")

legend("bottom", legend=c("raw", "seasonally adjusted"), lty=c(1,2),
 col=c("#000000FF", "#00009999"), bty="n")



Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s