Skip to content

Commit 95089e0

Browse files
Workaround for as.POSIXct() in R (< 4.3.0)
1 parent c503377 commit 95089e0

File tree

3 files changed

+11
-1
lines changed

3 files changed

+11
-1
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: future.p2p
22
Title: A Peer-to-Peer Compute Cluster via Futureverse
3-
Version: 0.3.0-9028
3+
Version: 0.3.0-9029
44
Description: Implementation of the 'Future' API <doi:10.32614/RJ-2021-048> that resolves futures on a peer-to-peer ('P2P') compute environment. By using this future backend, you and your friends can share your spare compute resources with each other.
55
Imports:
66
future (>= 1.67.0),

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ export(host_cluster)
1616
export(p2p_cluster_name)
1717
export(pico_username)
1818
export(worker)
19+
if (getRversion() < "4.3.0") S3method(as.POSIXct,numeric)
1920
importFrom(callr,r_bg)
2021
importFrom(future,Future)
2122
importFrom(future,FutureBackend)

R/001.import_future_functions.R

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,12 @@ future_supports_state_submitted <- local({
2525
.value
2626
}
2727
})
28+
29+
30+
## Backports
31+
#' @rawNamespace if (getRversion() < "4.3.0") S3method(as.POSIXct,numeric)
32+
if (getRversion() < "4.3.0") {
33+
as.POSIXct.numeric <- function(x, tz = "", origin, ...) {
34+
.POSIXct(if (missing(origin)) x else as.POSIXct(origin, tz = "GMT", ...) + x, tz)
35+
}
36+
}

0 commit comments

Comments
 (0)