From 1eff5a53b0bf616ebbbf7026b0f3df3faa825f8a Mon Sep 17 00:00:00 2001 From: gisler Date: Thu, 7 May 2020 23:30:43 +0200 Subject: [PATCH] Fixed error "Error in as.POSIXct.numeric(e) : 'origin' must be supplied" --- DESCRIPTION | 2 +- NEWS.md | 3 ++- R/rollback.R | 14 ++++++++------ 3 files changed, 11 insertions(+), 8 deletions(-) diff --git a/DESCRIPTION b/DESCRIPTION index 66ae7b2..be8caaf 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Package: DTSg Type: Package Title: A Class for Working with Time Series Based on 'data.table' and 'R6' with Largely Optional Reference Semantics -Version: 0.4.0.9000 +Version: 0.4.1 Authors@R: person("Gerold", "Hepp", email = "ghepp@iwag.tuwien.ac.at", role = c("aut", "cre")) Description: Basic time series functionalities such as listing of missing values, application of arbitrary aggregation as well as rolling window diff --git a/NEWS.md b/NEWS.md index 5776528..1f1dbe9 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,5 +1,6 @@ -## DTSg v0.4.0.9000 +## DTSg v0.4.1 +* Fixed error "Error in as.POSIXct.numeric(e) : 'origin' must be supplied" for upcoming R 4.1.0 * Slightly improved vignettes * Minor internal code improvements diff --git a/R/rollback.R b/R/rollback.R index c21352f..fcc6412 100644 --- a/R/rollback.R +++ b/R/rollback.R @@ -60,14 +60,16 @@ rollback <- function(.dateTime, periodicity) { .dateTime <- structure( c( .dateTime[1L], - mapply( - rollToEndOfPreviousMonth, - lags = lags, - .dateTime = .dateTime[-1L], - MoreArgs = list(clause = clause, periodicity = periodicity) + do.call( + c, + Map( + rollToEndOfPreviousMonth, + lags = lags, + .dateTime = .dateTime[-1L], + MoreArgs = list(clause = clause, periodicity = periodicity) + ) ) ), - class = class(.dateTime), tzone = attr(.dateTime, "tzone") ) }