This was fixed in the zoo devel version (to be zoo 1.5-4) just last week. See:
http://r-forge.r-project.org/plugins/scmsvn/viewcvs.php/*checkout*/pkg/NEWS?rev=487&root=zoo
You can either wait for that, use the workaround you found or source
the fixed version
of plot.zoo:
source("http://r-forge.
BB <- structure(list(Yearmonth = structure(c(12L, 24L, 1L, 13L, 14L,
3L, 15L, 4L, 16L, 5L, 17L, 6L, 18L, 7L, 19L, 8L, 20L, 9L, 21L,
10L, 22L, 11L, 23L), .Label = c("2006-02", "2006-03", "2006-04",
"2006-05", "2006-06", "2006-07", "2006-08", "2006-09", "2006-10",
"2006-11", "2006-12", "2007-01", "20
n <-
c("f","m","a","m","j","j","a","s","o","n","d","j","f","m","a","m","j","j","a","s","o","n","d","j")
plot(x.zoo[, 95], xaxt = "n", ylim=c(1,2))
rng <- range(time(x.zoo))
axis(1, at = seq(rng[1], rng[2], 1/12), labels = n, tcl = -0.3)
#why do I have to put in the y-lim explicitly? If you try th
Its a bug in axis.zoo. I have just fixed it in the svn repository so try this:
source("http://r-forge.r-project.org/plugins/scmsvn/viewcvs.php/*checkout*/pkg/R/yearmon.R?rev=485&root=zoo";)
plot(x.zoo[, 25])
axis.zoo uses the same algorithm as axis.Date in R and so it gives
similar results:
# u
On Tue, Jul 8, 2008 at 2:59 PM, stephen sefick <[EMAIL PROTECTED]> wrote:
> x.zoo <- zoo(x,as.yearmon(as.character(x$Yearmonth), "%Y-%m"))
> plot(x.zoo[,25])
1. You are trying to pass data frame to zoo whereas it must be a numeric vector,
matrix or a factor. See ?zoo and try this:
x.zoo <- zoo(
That worked fine- now one more question-
plot(x.zoo[,25])
produces a graph with True as the first label on the x-axis
1. why?
2. is it wrong to assume this is february 2006?
thanks
stephen
R2.7.1 Windows XP (I updated zoo last week when I installed 2.7.1)
On Tue, Jul 8, 2008 at 3:17 PM, Gabor Gr
x.zoo <- zoo(x,as.yearmon(as.character(x$Yearmonth), "%Y-%m"))
plot(x.zoo[,25])
#Error in plot.window(...) : invalid 'ylim' value
#there are values
On Tue, Jul 8, 2008 at 2:55 PM, Gabor Grothendieck <[EMAIL PROTECTED]>
wrote:
> On Tue, Jul 8, 2008 at 2:43 PM, Gabor Grothendieck
> <[EMAIL PROTECT
#this is the whole data frame and I tried the suggested and it looks like it
is working but will not plot. thanks agian
x <- structure(list(Yearmonth = structure(c(12L, 24L, 1L, 13L, 14L,
3L, 15L, 4L, 16L, 5L, 17L, 6L, 18L, 7L, 19L, 8L, 20L, 9L, 21L,
10L, 22L, 11L, 23L), .Label = c("2006-02", "200
On Tue, Jul 8, 2008 at 2:43 PM, Gabor Grothendieck
<[EMAIL PROTECTED]> wrote:
> There is no data in your data frame, just index info, so I assume you
> want a zero width time series:
>
> zoo(, as.yearmon(x$Yearmonth, "%Y-%m"))
>
> This also works but then you are left with a character date which yo
There is no data in your data frame, just index info, so I assume you
want a zero width time series:
zoo(, as.yearmon(x$Yearmonth, "%Y-%m"))
This also works but then you are left with a character date which you
may not want:
zoo(, x$Yearmonth)
On Tue, Jul 8, 2008 at 1:43 PM, stephen sefick <[E
#this is a subset of a larger data frame and I am okay with subsetting it as
there are redundant time stamps, but I would like to create a zoo object out
of this and I am having a hard #time figuring out how to do this the date
structure is year and then month
x <- structure(list(Yearmonth = str
11 matches
Mail list logo