Skip to content

Commit c3214f1

Browse files
authored
Merge pull request #84 from tscnlab/dev
Navigation menu changes
2 parents df4044f + b54bb27 commit c3214f1

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+4841
-8
lines changed

DESCRIPTION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
Package: LightLogR
22
Title: Process Data from Wearable Light Loggers and Optical Radiation Dosimeters
3-
Version: 0.10.0
3+
Version: 0.10.1
44
Authors@R: c(
55
person("Johannes", "Zauner",
66
email = "johannes.zauner@tum.de", role = c("aut", "cre"),

NEWS.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
# LightLogR 0.10.1
2+
3+
* `extract_metric()` give more helpful error messages when using a base dataset without start/end columns.
4+
5+
* `mean_daily()` can output the number of days that factor into the calculations by setting `.n = TRUE`.
6+
17
# LightLogR 0.10.0 **High noon**
28

39
## General improvements and new functions

R/extract_metric.R

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,9 @@ extract_metric <- function(
6161

6262
#if identifying.colname ist not part of the dataset, it will be added from the extracted_data
6363
if (!cc.name %in% names(data)) {
64+
if(!all(c("start", "end") %in% names(extracted_data))) {
65+
stop("start and/or end columns are missing in extracted_data, please either choose and `identifying.colname` that is part of `extracted_data`, or add start and end columns.")
66+
}
6467
data <-
6568
data |>
6669
dplyr::left_join(

R/mean_daily.R

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,8 @@
3535
#' affected).
3636
#' @param Datetime2Time.circular Logical of whether Time should be circular.
3737
#' Will be ignored if `Datetime2Time = FALSE`. Default is `FALSE`.
38+
#' @param .n Logical, whether the number of days that went into each category
39+
#' should be output. Default is `FALSE`.
3840
#'
3941
#' @return A dataframe with three rows representing average weekday, weekend,
4042
#' and mean daily values of all numeric columns
@@ -69,7 +71,8 @@ mean_daily <- function(data,
6971
filter.empty = FALSE,
7072
sub.zero = FALSE,
7173
Datetime2Time = TRUE,
72-
Datetime2Time.circular = FALSE
74+
Datetime2Time.circular = FALSE,
75+
.n = FALSE
7376
) {
7477

7578
# Input validation
@@ -134,6 +137,7 @@ mean_daily <- function(data,
134137
mean(x, na.rm = na.rm)
135138
},
136139
.names = "{prefix}{.col}"),
140+
.n = dplyr::n(),
137141
.groups = "drop_last")
138142

139143
if(nrow(weekday_type) == 0) {
@@ -172,14 +176,15 @@ mean_daily <- function(data,
172176
)
173177
)|>
174178
dplyr::summarize(
175-
dplyr::across(-c({{ Weekend.type }}, dplyr::where(lubridate::is.Date)),
179+
dplyr::across(-c({{ Weekend.type }}, .n, dplyr::where(lubridate::is.Date)),
176180
\(x) if(inherits(x, "Duration")) {
177181
lubridate::duration(sum(x*.weight)/7) |> round(0)
178182
} else if (inherits(x, "hms")) {
179183
hms::as_hms((sum(x*.weight)/7) |> round(0))
180184
} else {
181185
sum(x*.weight)/7
182186
}),
187+
.n = sum(.n),
183188
.groups = "keep"
184189
) |>
185190
dplyr::select(-.weight) |>
@@ -191,6 +196,10 @@ mean_daily <- function(data,
191196
dplyr::bind_rows(mean_daily) |>
192197
dplyr::arrange({{ Weekend.type }}, .by_group = TRUE)
193198

199+
if(!.n) {
200+
weekday_type <- weekday_type |> dplyr::select(-.n)
201+
}
202+
194203
#filter out empty rows
195204
if(filter.empty){
196205
weekday_type |>

README.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -330,7 +330,7 @@ If you would like to use a metric you don't find represented in LightLogR, pleas
330330

331331
## About the creation and funding of LightLogR
332332

333-
**LightLogR** is developed by the [*Translational Sensory & Circadian Neuroscience*](https://www.tscnlab.org) lab, a joint group from the [Technical University of Munich](https://www.tum.de/en/) and the [Max Planck Institute for Biological Neuroscience Unit (MPS/TUM/TUMCREATE)\*](https://www.tscnlab.org), a joint group based at the [Technical University of Munich](https://www.tum.de/en/), [TUMCREATE](https://www.tum-create.edu.sg/), the [Max Planck Institute for Biological Cybernetics](https://www.mpg.de/152075/biological-cybernetics).
333+
**LightLogR** is developed by the [*Translational Sensory & Circadian Neuroscience Unit (MPS/TUM/TUMCREATE*](https://www.tscnlab.org), a joint group based at the [Max Planck Institute for Biological Cybernetics](https://www.mpg.de/152075/biological-cybernetics), the [Technical University of Munich](https://www.tum.de/en/), and [TUMCREATE](https://www.tum-create.edu.sg/), .
334334

335335
[*MeLiDos*](https://www.melidos.eu) is a joint, [EURAMET](https://www.euramet.org)-funded project involving sixteen partners across Europe, aimed at developing a metrology and a standard workflow for wearable light logger data and optical radiation dosimeters. Its primary contributions towards fostering FAIR data include the development of a common file format, robust metadata descriptors, and an accompanying open-source software ecosystem.
336336

_pkgdown.yml

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@ navbar:
99
newsletter:
1010
text: Newsletter
1111
menu:
12+
- text: January 2026
13+
href: Edition02.html
1214
- text: July 2025
1315
href: Edition01.html
1416
resources:
@@ -19,8 +21,8 @@ navbar:
1921
- text: Course website
2022
href: https://tscnlab.github.io/LightLogR_webinar/
2123
target: "_blank"
22-
- text: Flyer (2025/26)
23-
href: pdf/Online_course_series_2025-26.pdf
24+
- text: Flyer
25+
href: https://tscnlab.github.io/LightLogR_webinar/assets/Online_course_series_2025-26.pdf
2426
target: "_blank"
2527
- text: ---
2628
- text: Talks
@@ -47,7 +49,7 @@ navbar:
4749
- text: The whole game
4850
href: articles/Day.html
4951
- text: Visual experience
50-
href: https://tscnlab.github.io/ZaunerEtAl_JVis_2025/
52+
href: https://tscnlab.github.io/ZaunerEtAl_JVis_2026/
5153
target: "_blank"
5254
- text: '---'
5355
- text: 'General Workflow'

man/mean_daily.Rd

Lines changed: 5 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)