From 8e1f6c7a15bf5ac56d5f5ed7271606a2255e6f82 Mon Sep 17 00:00:00 2001 From: jreps Date: Fri, 13 Sep 2024 12:42:47 -0400 Subject: [PATCH] fixing issue issue_330 (#334) fixing time plot x-axis --- R/helpers-sccsPlots.R | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/R/helpers-sccsPlots.R b/R/helpers-sccsPlots.R index 947557f..f066808 100644 --- a/R/helpers-sccsPlots.R +++ b/R/helpers-sccsPlots.R @@ -488,7 +488,15 @@ plotSeasonSpline <- function(seasonSpline, rrLim = c(0.1, 10)) { # unknown function? convertMonthToStartDate <- function(x){ - return(as.Date(x, origin = "1950-01-01")) + #return(as.Date(x, origin = "1950-01-01")) + year <- floor(x / 12) + month <- floor(x %% 12) + 1 + return(as.Date(sprintf( + "%s-%s-%s", + year, + month, + 1 + ))) } # adding missing sccsModel as input plotCalendarTimeSpline <- function(calendarTimeSpline, rrLim = c(0.1, 10)) {