[R-SIG-Finance] [R-sig-finance] Problem on ploting of a zoo object
Gabor Grothendieck
ggrothendieck at gmail.com
Thu Sep 24 21:25:51 CEST 2009
> set.seed(123)
> dat <- rnorm(100)
> date1 <- 35886
> dat2 <- zooreg(dat, as.Date(date1, origin="1900-01-01"), frequency=12)
> index(dat2) <- format(index(dat2), "%m/%y")
Warning message:
In diff(as.numeric(value)) : NAs introduced by coercion
In the last statement you've tried to assign the same time to every observation.
> dat2 <- zooreg(dat, as.Date(date1, origin="1900-01-01"), frequency=12)
> format(index(dat2), "%m/%y")
[1] "04/98" "04/98" "04/98" "04/98" "04/98" "04/98" "04/98" "04/98" "04/98"
[10] "04/98" "04/98" "04/98" "04/98" "04/98" "04/98" "04/98" "04/98" "04/98"
[19] "04/98" "04/98" "04/98" "04/98" "04/98" "04/98" "04/98" "04/98" "04/98"
[28] "04/98" "04/98" "04/98" "04/98" "04/98" "04/98" "04/98" "04/98" "04/98"
[37] "04/98" "04/98" "04/98" "04/98" "04/98" "04/98" "04/98" "04/98" "04/98"
[46] "04/98" "04/98" "04/98" "04/98" "04/98" "04/98" "04/98" "04/98" "04/98"
[55] "04/98" "04/98" "04/98" "04/98" "04/98" "04/98" "04/98" "04/98" "04/98"
[64] "04/98" "04/98" "04/98" "04/98" "04/98" "04/98" "04/98" "04/98" "04/98"
[73] "04/98" "04/98" "04/98" "04/98" "04/98" "04/98" "04/98" "04/98" "04/98"
[82] "04/98" "04/98" "04/98" "04/98" "04/98" "04/98" "04/98" "04/98" "04/98"
[91] "04/98" "04/98" "04/98" "04/98" "04/98" "04/98" "04/98" "04/98" "04/98"
[100] "04/98"
On Thu, Sep 24, 2009 at 3:18 PM, Bogaso <bogaso.christofer at gmail.com> wrote:
>
> Hi,
>
> Let say I have following codes
>
> dat <- rnorm(100)
> date1 <- 35886
> dat2 <- zooreg(dat, as.Date(date1, origin="1900-01-01"), frequency=12)
> index(dat2) <- format(index(dat2), "%m/%y")
>
> However when I try to plot "dat2", I got following error :
>
>> plot(dat2)
> Error in plot.window(...) : need finite 'xlim' values
> In addition: Warning messages:
> 1: In xy.coords(x, y, xlabel, ylabel, log) : NAs introduced by coercion
> 2: In min(x) : no non-missing arguments to min; returning Inf
> 3: In max(x) : no non-missing arguments to max; returning -Inf
>
> Can anyone please tell me how to get the plot?
>
> Thanks,
>
> --
> View this message in context: http://www.nabble.com/Problem-on-ploting-of-a-zoo-object-tp25579310p25579310.html
> Sent from the Rmetrics mailing list archive at Nabble.com.
>
> _______________________________________________
> R-SIG-Finance at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only.
> -- If you want to post, subscribe first.
>
More information about the R-SIG-Finance
mailing list