joshuaulrich / xts

Extensible time series class that provides uniform handling of many R time series classes by extending zoo.
http://joshuaulrich.github.io/xts/
GNU General Public License v2.0
220 stars 71 forks source link

2018-07-16 CRAN update.packages() with compile produces 0.11-0 xts with failed R_RegisterCCallable #254

Closed AndreMikulec closed 6 years ago

AndreMikulec commented 6 years ago

Hello,

If anyone installed xts from CRAN on 2018-07-16 ( the same day as the release date ) and perhaps .Call compiled it, then 'not-good' xts may have been produced with a not working R_RegisterCCallable

library(xts)
data(sample_matrix)
as.xts(sample_matrix)
Error in .Call("xts_set_dimnames", x, value, PACKAGE = "xts") :
  "xts_set_dimnames" not available for .Call() for package "xts"

However, today (2018-07-22) , when I installed xts in any of the three ways, xts works.

quit R

(1)
download source .zip from github
C:\Users\AnonymousUser\Downloads\xts-master\xts-master>R CMD INSTALL .
quit R

(2)
install.packages("xts")
quit R

(3)
install.packages("xts", type = "source")
quit R

All produced the correct answer.

> data(sample_matrix)
> as.xts(sample_matrix)
               Open     High      Low    Close
2007-01-02 50.03978 50.11778 49.95041 50.11778

So, this issue perhaps may be closed.

> devtools::session_info()
Session info ------------------------------------------------------------------
 setting  value
 version  R version 3.5.1 (2018-07-02)
 system   x86_64, mingw32
 ui       RTerm
 language (EN)
 collate  English_United States.1252
 tz       America/Chicago
 date     2018-07-22

Packages ----------------------------------------------------------------------
 package   * version date       source
 base      * 3.5.1   2018-07-02 local
 compiler    3.5.1   2018-07-02 local
 datasets  * 3.5.1   2018-07-02 local
 devtools    1.13.6  2018-06-27 CRAN (R 3.5.1)
 digest      0.6.15  2018-01-28 CRAN (R 3.5.0)
 graphics  * 3.5.1   2018-07-02 local
 grDevices * 3.5.1   2018-07-02 local
 grid        3.5.1   2018-07-02 local
 lattice     0.20-35 2017-03-25 CRAN (R 3.5.0)
 magrittr  * 1.5     2014-11-22 CRAN (R 3.5.0)
 memoise     1.1.0   2017-04-21 CRAN (R 3.5.0)
 methods   * 3.5.1   2018-07-02 local
 stats     * 3.5.1   2018-07-02 local
 tools       3.5.1   2018-07-02 local
 utils     * 3.5.1   2018-07-02 local
 withr       2.1.2   2018-04-27 Github (jimhester/withr@79d7b0d)
 xts       * 0.11-0  2018-07-16 CRAN (R 3.5.1)
 zoo       * 1.8-3   2018-07-16 CRAN (R 3.5.1)
joshuaulrich commented 6 years ago

I have strong doubts this is related to the day xts was installed. What does it mean to ".Call compile" a package? I have never heard of that before.

It's more likely it is related to the state of your Windows system and R processes using the xts package from your library. You also did not say how you initially installed xts on the release date. Did you install from source, or did you use the binary created by CRAN? Were any other R processes running with the xts shared library loaded at the time you installed the updated version?

I'm closing this because it isn't something I can fix by changing xts source code.

AndreMikulec commented 6 years ago

I am saying is the that problem does not seem to exist anymore, except for those people who installed xts with compiling on 2018-07-16. Those people may or may not have the same problem. I am just saying that for those people who do experience that same problem, a simple solution is to just do (today), install.packages('xts") or install.packages("xts", type = "source").