在Windows下面的子查詢代碼產生了不正確的XTS對象,但正常的工作我的Ubuntu機器上XTS時間的子查詢VS的Windows
library(xts)
theTimes <- seq(from=as.POSIXct('2016-03-10 12:00:00 CDT'),
to=as.POSIXct('2016-03-20 12:10:00 CDT'),by=60)
ExampleData <- xts(rep(1,length(theTimes)),theTimes)
CutExampleData <- ExampleData['T02:00/T16:00']
any(duplicated(index(CutExampleData))) ## Evaluates to TRUE on windows (incorrect) and FALSE on Ubuntu (correctly)
SessionInfo的Linux PC上:
R version 3.3.1 (2016-06-21)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 16.04.1 LTS
locale:
[1] LC_CTYPE=en_US.UTF-8 LC_NUMERIC=C LC_TIME=en_US.UTF-8 LC_COLLATE=en_US.UTF-8
[5] LC_MONETARY=en_US.UTF-8 LC_MESSAGES=en_US.UTF-8 LC_PAPER=en_US.UTF-8 LC_NAME=C
[9] LC_ADDRESS=C LC_TELEPHONE=C LC_MEASUREMENT=en_US.UTF-8 LC_IDENTIFICATION=C
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] RMySQL_0.10.9 DBI_0.5-1 Quandl_2.8.0 xts_0.9-7 zoo_1.7-13
loaded via a namespace (and not attached):
[1] httr_1.2.1 R6_2.1.3 tools_3.3.1 grid_3.3.1 jsonlite_1.0 lattice_0.20-33
Windows PC上的SessionInfo:
R version 3.3.2 (2016-10-31)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows 10 x64 (build 14393)
locale:
[1] LC_COLLATE=English_United States.1252
[2] LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252
[4] LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] xts_0.9-7 zoo_1.7-13
loaded via a namespace (and not attached):
[1] grid_3.3.2 lattice_0.20-34
我認爲這與DST有關,因爲t他的指數跨越了最近的切換日期。有任何想法嗎?
請編輯您的問題,在兩臺機器上包含'sessionInfo()'的輸出。 –