I’m looking to take a data series like the one contained here:
http://robjhyndman.com/tsdldata/roberts/beards.dat
…and load it into a zoo time series object in R. There is no table of date information, but it lists that it’s regular, annual, and starts in y=1866. This is what I’m attempting…
beard <- read.zoo('http://robjhyndman.com/tsdldata/roberts/beards.dat',
header=FALSE,
index.column=0,
start="1866-01-01",
format="%Y",
skip=4)
It mostly works, but ignores the “start” argument from zooreg.
So, I have a fine solution that reads this, then changes the index like so…
index(beard) <- as.Date(paste(seq(1866,1911, by=1),'-01-01',sep=''), format="%Y-%m-%d")
…but this would be slicker if there were an argument in read.zoo() that let me do this in a single call. Am I missing it, or is it a two-step problem?
Specify a custom
FUN=like this: