Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Accommodate r-devel changes in setdiff (fixes #132) #133

Merged
merged 1 commit into from
Sep 15, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.