Re: [R] Problem on plotting TS using GGPLOT

2009-09-25 Thread Gabor Grothendieck
Once you have reduced it to a data frame as already discussed, its just a ggplot2 problem so you can take it to the ggplot2 group: http://groups.google.com/group/ggplot2 On Fri, Sep 25, 2009 at 9:58 AM, Bogaso wrote: > > Thanks Gabor for your input. However I know there is option in "zoo" to plot

Re: [R] Problem on plotting TS using GGPLOT

2009-09-25 Thread Bogaso
Thanks Gabor for your input. However I know there is option in "zoo" to plot multiple time series. However I want to go with ggplot2 because it looks better. If anyone point me where is the problem in my ggplot2 code, I would be truly grateful. Thanks, Gabor Grothendieck wrote: > > First get

Re: [R] Problem on plotting TS using GGPLOT

2009-09-25 Thread Gabor Grothendieck
First get the correct representation which here would be a multivariate zoo series with 51 time points and 6 components series and then plot it using zoo's plot function: z <- zoo(matrix(dat, 51), time(dat2)) # all in one panel plot(z, pch = letters[1:6], screen = 1, type = "b", col = 1:6) # or

Re: [R] Problem on plotting TS using GGPLOT

2009-09-25 Thread Bogaso
Let me be more specific. My goal is to plot following multiple TS, using ggplot2 dat1 <- zooreg(matrix(rnorm(306), 51), as.yearmon(as.Date("2000-01-01")), frequency=12) colnames(dat1) <- letters[1:6] dat1 Still I can not get what is problem in my ggplot2 codes. Please give some idea. Best, Bo

Re: [R] Problem on plotting TS using GGPLOT

2009-09-25 Thread Bogaso
Thanks for this reply. Here my goal is to plot multiple time series in the same plotting window. Here y variable has 306 elements, however each value is associated with factor which is represented by "vv" variable. I want to plot total 6 time series, for example 1st 51 values of y, represented b

Re: [R] Problem on plotting TS using GGPLOT

2009-09-25 Thread ONKELINX, Thierry
You are mixing data from two datasets with different lengths. Your x variable has 51 elements, while the y variable has 306 elements? What did you expect to happen with that? Use only one dataset within a geom(). Otherwise you are likely the get in troubles. HTH, Thierry ---