Hi,
Some time series have missing values in the time index. For example
historical data on business cycles will typically date them from peak to
trough, but some information may be missing. In most cases, this does
not cause trouble,
but if the first date is missing (e.g., we know the date of the first
trough but not the earlier peak), we want the first element in a list of
dates to be NA. Using yearmon, this causes trouble. Consider this:
> x <- as.yearmon("March 2010","%B %Y")
> y <- c(x,NA)
> z <- c(NA,x)
> y <- yearmon(y)
> z <- yearmon(z)
> y
[1] "Mar 2010" NA
> z
Error in charToDate(x) :
character string is not in a standard unambiguous format
Can someone explain how to make an object of type yearmon with a missing
value in its first element?
Thanks.
Marsh Feldman
______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.