quantmod icon indicating copy to clipboard operation
quantmod copied to clipboard

Remove S4 classes

Open joshuaulrich opened this issue 6 years ago • 4 comments

The setOldClass("xts") and setOldClass("zoo") calls in quantmod cause issues if other packages need to define those classes as well. For example, see https://github.com/edzer/spacetime/issues/35, and a StackOverflow question I answered a couple years ago.

I mentioned these to @jaryan and he would prefer to remove all the S4 classes from quantmod.

joshuaulrich avatar May 16 '19 11:05 joshuaulrich

I guess the following comment from the sources of the methods package also holds for "xts":

https://github.com/wch/r-source/blob/be05889aa5646e2c456486fd584be873ef3acd62/src/library/methods/R/BasicClasses.R#L531-L532

So maybe xts itself could setOldClass("xts") ?

bastistician avatar May 20 '19 14:05 bastistician

Thanks for the suggestion @bastistician. That thought crossed my mind as well. Would you have time to try that and report back?

joshuaulrich avatar May 21 '19 11:05 joshuaulrich

Has anyone fixed this yet? It is still bothering me.

nguinasso avatar Oct 14 '21 16:10 nguinasso

@nguinasso I just tried to address it. It's going to take coordination with other package authors to get it released, so that may take several weeks.

joshuaulrich avatar Oct 16 '21 14:10 joshuaulrich