Skip to content

Commit

Permalink
Merge pull request #19 from tscnlab/development_dosimetry-metrics
Browse files Browse the repository at this point in the history
  • Loading branch information
JZauner authored Jun 18, 2024
2 parents d12bf30 + e9bc3bc commit 8e559c9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 4 deletions.
2 changes: 1 addition & 1 deletion DESCRIPTION
Original file line number Diff line number Diff line change
@@ -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 = "[email protected]", role = c("aut", "cre"),
Expand Down
4 changes: 4 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
5 changes: 2 additions & 3 deletions R/metric_bright_dark_period.R
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit 8e559c9

Please sign in to comment.