Skip to content

Commit

Permalink
Accommodate r-devel changes in setdiff (#133)
Browse files Browse the repository at this point in the history
  • Loading branch information
eddelbuettel authored Sep 15, 2024
1 parent 519c4b7 commit 6e6503a
Show file tree
Hide file tree
Showing 6 changed files with 27 additions and 4 deletions.
9 changes: 9 additions & 0 deletions ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,12 @@
2024-09-09 Dirk Eddelbuettel <[email protected]>

* DESCRIPTION (Version, Date): Roll minor version and date

* R/nanoival.R (setdiff): Under R 4.5.0, call setdiff for integer64
* R/nanotime.R (setMethod): Under R 4.5.0, define unique method
* NAMESPACE: Conditionally export unique
* man/nanotime.Rd: Alias unique

2024-08-31 Dirk Eddelbuettel <[email protected]>

* DESCRIPTION (Authors@R): Added
Expand Down
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: nanotime
Type: Package
Title: Nanosecond-Resolution Time Support for R
Version: 0.3.9.1
Date: 2024-06-22
Version: 0.3.9.2
Date: 2024-09-09
Authors@R: c(person("Dirk", "Eddelbuettel", role = c("aut", "cre"), email = "[email protected]",
comment = c(ORCID = "0000-0001-6419-907X")),
person("Leonardo", "Silvestri", role = "aut"))
Expand All @@ -16,7 +16,7 @@ LinkingTo: Rcpp, RcppCCTZ, RcppDate
License: GPL (>= 2)
URL: https://github.com/eddelbuettel/nanotime, https://eddelbuettel.github.io/nanotime/, https://dirk.eddelbuettel.com/code/nanotime.html
BugReports: https://github.com/eddelbuettel/nanotime/issues
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
Collate: 'nanotime.R' 'nanoival.R' 'nanoduration.R' 'nanoperiod.R' 'RcppExports.R'
Encoding: UTF-8
NeedsCompilation: yes
Expand Down
2 changes: 2 additions & 0 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -114,3 +114,5 @@ exportMethods(nano_floor)

S3method("%in%", nanotime)
exportMethods("%in%")

if (getRversion() > "4.5.0") exportMethods(unique)
2 changes: 1 addition & 1 deletion R/nanoival.R
Original file line number Diff line number Diff line change
Expand Up @@ -818,7 +818,7 @@ setMethod("union",
setMethod("setdiff",
c("nanotime", "nanotime"),
function(x, y) {
res <- callNextMethod()
res <- if (getRversion() >= "4.5.0") setdiff(as.integer64(x), as.integer64(y)) else callNextMethod()
oldClass(res) <- "integer64"
new("nanotime", res)
})
Expand Down
11 changes: 11 additions & 0 deletions R/nanotime.R
Original file line number Diff line number Diff line change
Expand Up @@ -1048,3 +1048,14 @@ setMethod("rep", c(x = "nanotime"), function(x, ...) {
as.character.nanotime <- function(x, ...) {
format(x, ...)
}

if (getRversion() > "4.5.0") {
##' @rdname nanotime
setMethod("unique",
"nanotime",
function(x) {
res <- callNextMethod()
oldClass(res) <- "integer64"
new("nanotime", res)
})
}
1 change: 1 addition & 0 deletions man/nanotime.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 6e6503a

Please sign in to comment.