From 10696e4cf4ae92371917ed8ccaec2b0183da145c Mon Sep 17 00:00:00 2001 From: Thomas Bock Date: Thu, 19 Sep 2024 18:20:52 +0200 Subject: [PATCH] Ensure correct data type of NA timestamps Up until now, `get.data.cut.to.same.date(data.sources = c("issues", "mails", "commits"))` failed if some of the first data source was empty, but not if the second one was empty. The reason was that `NA` values introduced by empty data sources at the beginning of the data frame turned the data frame into a data frame of numeric objects instead of POSIXct objects. If there were already POSIXct objects in the data frame, this did not happen. To prevent the timestamps to be interpreted as numeric values, make sure that the `NA` values are always POSIXct objects. This fixes #269. Signed-off-by: Thomas Bock --- util-data.R | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/util-data.R b/util-data.R index 90c01ca4..6edc899b 100644 --- a/util-data.R +++ b/util-data.R @@ -797,8 +797,8 @@ ProjectData = R6::R6Class("ProjectData", } ## NAs otherwise else { - source.date.min = NA - source.date.max = NA + source.date.min = as.POSIXct(NA) + source.date.max = as.POSIXct(NA) } ## remove old line if existing