2

R 2.12.1 を実行している 2 つの環境間で動作の違いを見つけています。最初の 1 つの動物園では、期待どおりに動作します。

> library(zoo)
> x.date <- as.Date(paste(2003, 2, c(1, 3, 7, 9, 14), sep = "-"))
    > x <- zoo(rnorm(5), x.date)
    > index(x)
    [1] "2003-02-01" "2003-02-03" "2003-02-07" "2003-02-09" "2003-02-14"
    > as.Date(index(x))
    [1] "2003-02-01" "2003-02-03" "2003-02-07" "2003-02-09" "2003-02-14"
> sessionInfo()
R version 2.12.1 (2010-12-16)
Platform: x86_64-unknown-linux-gnu (64-bit)

locale:
[1] C

attached base packages:
[1] grid      stats     graphics  grDevices utils     datasets  methods   base

other attached packages:
[1] ggplot2_0.8.9 proto_0.3-9.1 reshape_0.8.4 MASS_7.3-9    plyr_1.4      RODBC_1.3-2   zoo_1.6-4

loaded via a namespace (and not attached):
[1] lattice_0.19-13 tools_2.12.1

もう一方では、次の出力が得られます。

> library(zoo)
> x.date <- as.Date(paste(2003, 2, c(1, 3, 7, 9, 14), sep = "-"))
> x <- zoo(rnorm(5), x.date)
> index(x)
[1] "02/01/2003 00:00:00.000 UTC" "02/03/2003 00:00:00.000 UTC" "02/07/2003 00:00:00.000 UTC" "02/09/2003 00:00:00.000 UTC" "02/14/2003 00:00:00.000 UTC"
> as.Date(index(x))
[1] "02/01/2003 00:00:00.000 UTC" "02/03/2003 00:00:00.000 UTC" "02/07/2003 00:00:00.000 UTC" "02/09/2003 00:00:00.000 UTC" "02/14/2003 00:00:00.000 UTC"
> sessionInfo()
R version 2.12.1 (2010-12-16)
Platform: x86_64-unknown-linux-gnu (64-bit)

locale:
[1] C

attached base packages:
[1] grid      grDevices graphics  stats     datasets  utils     methods   base

other attached packages:
[1] zoo_1.6-4     ggplot2_0.8.9 proto_0.3-8   reshape_0.8.4 plyr_1.4

loaded via a namespace (and not attached):
[1] digest_0.4.2    lattice_0.19-13

奇妙なだけでなく、後者の動作により ggplot2 からエラー メッセージが表示されます。洞察はありますか?前もって感謝します。

4

0 に答える 0