Skip to content

Commit

Permalink
Add and export xts S4 class
Browse files Browse the repository at this point in the history
A few packages need xts as a S4 class. I know quantmod and spacetime
both create an xts S4 class. The class definition belongs in the
package that owns the class.

See joshuaulrich/quantmod#269
  • Loading branch information
joshuaulrich committed Oct 16, 2021
1 parent 81ef49a commit 8ca448e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 0 deletions.
3 changes: 3 additions & 0 deletions NAMESPACE
Expand Up @@ -196,6 +196,9 @@ S3method(make.index.unique, POSIXct)
S3method(is.time.unique, xts)
S3method(is.time.unique, zoo)

# export xts S4 class (for quantmod, spacetime, etc.)
exportClasses(xts)

# xts methods
importFrom(zoo,coredata)
importFrom(zoo, index)
Expand Down
3 changes: 3 additions & 0 deletions R/xts.R
Expand Up @@ -31,6 +31,9 @@
# xts methods (which match foreign conversion methods in other files)
# are also defined below

# For S4 extensions
setOldClass("xts")

`xts` <-
function(x=NULL,
order.by=index(x),
Expand Down

0 comments on commit 8ca448e

Please sign in to comment.