diff --git a/DESCRIPTION b/DESCRIPTION index a858825..652c971 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,6 +1,6 @@ Package: LightLogR Title: Work With Data from Wearable Light Loggers and Optical Radiation Dosimeters -Version: 0.3.5 +Version: 0.3.6 Authors@R: c( person("Johannes", "Zauner", email = "johannes.zauner@tum.de", role = c("aut", "cre"), diff --git a/NEWS.md b/NEWS.md index 3a39927..dc69d6d 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,3 +1,7 @@ +# LightLogR 0.3.6 + +* `bright_dark_period()` now maintains the date when looping the data. + # LightLogR 0.3.5 * Added the function `aggregate_Date()` to aggregate long datasets to one day per group. diff --git a/R/metric_bright_dark_period.R b/R/metric_bright_dark_period.R index 63d49f8..ffb481d 100755 --- a/R/metric_bright_dark_period.R +++ b/R/metric_bright_dark_period.R @@ -57,7 +57,7 @@ #' dplyr::reframe(bright_dark_period(MEDI, Datetime, "brightest", "10 hours", #' as.df = TRUE)) #' dataset1 %>% -#' dplyr::reframe(bright_dark_period(MEDI, Datetime, "darkest", "5 hours", +#' dplyr::reframe(bright_dark_period(MEDI, Datetime, "darkest", "7 hours", #' loop = TRUE, as.df = TRUE)) #' #' # Dataset with duration as Time.vector @@ -125,8 +125,7 @@ bright_dark_period <- function(Light.vector, # Loop data if (loop) { Light.vector <- c(Light.vector, Light.vector) - span <- dplyr::last(Time.vector) - Time.vector[1] - Time.vector <- c(Time.vector, Time.vector + span + epoch) + Time.vector <- c(Time.vector, Time.vector) } # Calculate window size