Skip to content

Commit 62d0c67

Browse files
authored
Merge pull request #61 from tscnlab/dev
LightLogR 0.9.2 - CRAN release
2 parents 496ef37 + f9548a2 commit 62d0c67

20 files changed

+100
-42
lines changed

CRAN-SUBMISSION

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
1-
Version: 0.5.3
2-
Date: 2025-02-24 17:54:45 UTC
3-
SHA: 0681d9bf9f64ece1aa13412aaaef6162f83be5dc
1+
Version: 0.9.2
2+
Date: 2025-06-10 10:54:06 UTC
3+
SHA: cb69b27469411ee407f80fc6b3358f57c54b8d64

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.9.1
3+
Version: 0.9.2
44
Authors@R: c(
55
person("Johannes", "Zauner",
66
email = "[email protected]", role = c("aut", "cre"),

NAMESPACE

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ export(barroso_lighting_metrics)
1919
export(bright_dark_period)
2020
export(centroidLE)
2121
export(count_difftime)
22+
export(create_Timedata)
2223
export(cut_Datetime)
2324
export(data2reference)
2425
export(disparity_index)

NEWS.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# LightLogR 0.9.2
2+
13
# LightLogR 0.9.1
24

35
* `add_Date_col()` is a new convenience function to add a Date column to the dataset, optionally showing the weekday.
@@ -12,7 +14,7 @@
1214

1315
* removed `LYS` wearable sample file, due to package size limitations
1416

15-
* `add_Time_col()` replaces `create_Time_data()`
17+
* `add_Time_col()` replaces `create_Time_data()`, also, the new column is called `Time` by default instead of `Time.data`
1618

1719
* `extract_clusters()` has the option to show the cluster condition in the output with `add.label = TRUE`, e.g., `MEDI>500|d≥30min|i≤5min` for clusters of melanopic EDI larger than 500, at least 30 minutes long (`d`), allowing interruptions of up to 5 minutes at a time (`i`).
1820

R/Brown.R

Lines changed: 16 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -230,11 +230,16 @@ Brown_rec <- function(state,
230230
#' `vector_labels`
231231
#'
232232
#' @param dataset A light exposure dataframe
233-
#' @param MEDI.colname The colname containing melanopic EDI values (or, alternatively, Illuminance). Defaults to `MEDI`. Expects a symbol.
234-
#' @param New.state.colname Name of the new column that will contain the cut data. Expects a symbol.
233+
#' @param MEDI.colname The colname containing melanopic EDI values (or,
234+
#' alternatively, Illuminance). Defaults to `MEDI`. Expects a symbol.
235+
#' @param New.state.colname Name of the new column that will contain the cut
236+
#' data. Expects a symbol.
235237
#' @param vector_cuts Numeric vector of breaks for the cuts.
236-
#' @param vector_labels Vecotr of labels for the cuts. Must be one entry shorter than `vector_cuts`.
237-
#' @param overwrite Logical. Should the `New.state.colname` overwrite a preexisting column in the dataset
238+
#' @param vector_labels Vector of labels for the cuts. Must be one entry shorter
239+
#' than `vector_cuts`. `"default"` will produce nice labels for the default
240+
#' setting of `vector_cuts` (and throw an error otherwise).
241+
#' @param overwrite Logical. Should the `New.state.colname` overwrite a
242+
#' preexisting column in the dataset
238243
#'
239244
#' @return The input dataset with an additional (or overwritten) column
240245
#' containing a cut light vector
@@ -245,18 +250,22 @@ Brown_rec <- function(state,
245250
#'
246251
#' @family Brown
247252
#' @examples
248-
#' sample.data.environment |>
249-
#' Brown_cut() |>
253+
#' sample.data.environment |>
254+
#' Brown_cut(vector_labels = c("0-1lx", "1-10lx", "10-250lx", "250lx-Inf")) |>
250255
#' dplyr::count(state)
251256
#'
252257
Brown_cut <- function(dataset,
253258
MEDI.colname = MEDI,
254259
New.state.colname = state,
255260
vector_cuts = c(-Inf, 1, 10, 250, Inf),
256-
vector_labels = c("\U{2264}1lx", "\U{2264}10lx", NA, "\U{2265}250lx"),
261+
vector_labels = "default",
257262
overwrite = TRUE
258263
){
259264

265+
if(all(vector_labels == "default", c(-Inf, 1, 10, 250, Inf) %in% vector_cuts)) {
266+
vector_labels <- c("\U{2264}1lx", "\U{2264}10lx", NA, "\U{2265}250lx")
267+
}
268+
260269
stopifnot("vector_cuts need to be numeric" =
261270
is.numeric(vector_cuts),
262271
"vector_labels need to be shorter by exactly one compared to vector_cuts" =

R/add_Time_col.R

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,3 +43,20 @@ add_Time_col <- function(dataset,
4343
if(output.dataset) dataset else dataset[[colname.defused({{ Time.colname }})]]
4444

4545
}
46+
47+
48+
#' create_Timedata
49+
#'
50+
#' @param ... Input arguments to [add_Time_col()]
51+
#'
52+
#' @returns a `data.frame` object identical to `dataset` but with the added
53+
#' column of Time-of-Day data, or a `vector` with the Time-of-Day-data
54+
#' @export
55+
#'
56+
#' @examples
57+
#' sample.data.environment %>% create_Timedata()
58+
#'
59+
create_Timedata <- function(...) {
60+
.Deprecated("add_Time_col", msg = "`create_Timedata()` is deprecated as of LightLogR 0.9.1. Please use `add_Time_col()` instead. ")
61+
add_Time_col(...)
62+
}

R/clusters.R

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@
5555
#' groups further, e.g. through [summarize_numeric()] - having an empty group
5656
#' present is important when averaging numbers.
5757
#' @param add.label Logical. Option to add a label to the output containing the
58-
#' condition. E.g., `MEDI>500|d30min|i5min` for clusters of melanopic EDI
58+
#' condition. E.g., `MEDI>500|d>=30min|i<=5min` for clusters of melanopic EDI
5959
#' larger than 500, at least 30 minutes long (`d`), allowing interruptions of
6060
#' up to 5 minutes at a time (`i`).
6161
#'
@@ -78,8 +78,7 @@
7878
#' extract_clusters(
7979
#' MEDI > 250,
8080
#' cluster.duration = "1 hour",
81-
#' interruption.duration = "5 mins",
82-
#' add.label = TRUE
81+
#' interruption.duration = "5 mins"
8382
#' )
8483
extract_clusters <- function(
8584
data,

R/data.r

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@
8888
#' <https://www.cie.co.at/publications/cie-system-metrology-optical-radiation-iprgc-influenced-responses-light-0>
8989
#' @source
9090
#' <https://cie.co.at/datatable/cie-spectral-luminous-efficiency-photopic-vision>
91-
#' @source <http://files.cie.co.at/S026_Table2_Data.xlsx>
91+
#' @source <https://files.cie.co.at/CIE S 026 alpha-opic Toolbox.xlsx>
9292
#' @references CIE (2019). ISO/CIE 11664-1:2019(E). Colorimetry — Part 1: CIE
9393
#' standard colorimetric observers. Vienna, CIE
9494
#' @references CIE (2018). CIE S 026/E:2018. CIE system for metrology of optical

R/gg_gaps.R

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -139,7 +139,7 @@ gg_gaps <- function(dataset,
139139
dataset |>
140140
gg_days(y.axis = {{ Variable.colname }}, x.axis = {{ Datetime.colname }},...) +
141141
ggplot2::geom_point(data = irregulars, col = col.irregular) +
142-
ggplot2::labs(title = paste0("Irregular data (", col.irregular ,")"))
142+
ggplot2::labs(title = paste0("Irregular data (", col.irregular ," dots)"))
143143

144144
return(plot)
145145
}
@@ -150,7 +150,7 @@ gg_gaps <- function(dataset,
150150
data_regular |>
151151
gg_days(y.axis = {{ Variable.colname }}, x.axis = {{ Datetime.colname }},...) |>
152152
gg_state(gaps, fill = fill.gaps, alpha = alpha) +
153-
ggplot2::labs(title = paste0("Gaps in the data (", fill.gaps ,")"))
153+
ggplot2::labs(title = paste0("Gaps in the data (", fill.gaps ," areas)"))
154154

155155
return(plot)
156156
}
@@ -159,6 +159,6 @@ gg_gaps <- function(dataset,
159159
gg_days(y.axis = {{ Variable.colname }}, x.axis = {{ Datetime.colname }},...) |>
160160
gg_state(gaps, fill = fill.gaps, alpha = alpha) +
161161
ggplot2::geom_point(data = irregulars, col = col.irregular) +
162-
ggplot2::labs(title = paste0("Gaps (", fill.gaps ,") and irregular (", col.irregular ,") data"))
162+
ggplot2::labs(title = paste0("Gaps (", fill.gaps ," areas) and irregular (", col.irregular ," dots) data"))
163163

164164
}

R/gg_state.R

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -38,11 +38,8 @@
3838
#' #(+aggregating Data to 5 minute intervals & reducing it to three days)
3939
#' state_data <-
4040
#' sample.data.environment |>
41-
#' dplyr::mutate(state = MEDI > 250,
42-
#' state2 = cut(MEDI,
43-
#' breaks = c(-1,1,10,250, Inf),
44-
#' labels = c("≤1lx", "≤10lx", NA, "≥250lx"))
45-
#' ) |>
41+
#' dplyr::mutate(state = MEDI > 250) |>
42+
#' Brown_cut(MEDI, state2) |>
4643
#' aggregate_Datetime(unit = "5 mins") |>
4744
#' filter_Datetime(length = "3 days")
4845
#'

README.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ knitr::opts_chunk$set(
1818
<!-- badges: start -->
1919

2020
[![R-CMD-check](https://github.com/tscnlab/LightLogR/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/tscnlab/LightLogR/actions/workflows/R-CMD-check.yaml) [![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.11562600.svg)](https://doi.org/10.5281/zenodo.11562600) [![CRAN status](https://www.r-pkg.org/badges/version/LightLogR)](https://CRAN.R-project.org/package=LightLogR)
21-
[![status](https://joss.theoj.org/papers/3a1057dccd315b7eb8683c1b969402e2/status.svg)](https://joss.theoj.org/papers/3a1057dccd315b7eb8683c1b969402e2)
21+
[![status](https://joss.theoj.org/papers/10.21105/joss.07601/status.svg)](https://joss.theoj.org/papers/10.21105/joss.07601)
2222

2323
<!-- badges: end -->
2424

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.11562600.svg)](https://doi.org/10.5281/zenodo.11562600)
1010
[![CRAN
1111
status](https://www.r-pkg.org/badges/version/LightLogR)](https://CRAN.R-project.org/package=LightLogR)
12-
[![status](https://joss.theoj.org/papers/3a1057dccd315b7eb8683c1b969402e2/status.svg)](https://joss.theoj.org/papers/3a1057dccd315b7eb8683c1b969402e2)
12+
[![status](https://joss.theoj.org/papers/10.21105/joss.07601/status.svg)](https://joss.theoj.org/papers/10.21105/joss.07601)
1313

1414
<!-- badges: end -->
1515

_pkgdown.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@ reference:
4747
- add_Date_col
4848
- aggregate_Date
4949
- aggregate_Datetime
50+
- create_Timedata
5051
- cut_Datetime
5152
- dst_change_handler
5253
- filter_Datetime

cran-comments.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,12 @@
1+
## Submission Version 0.9.2
2+
3+
### R CMD check results
4+
5+
0 errors ✔ | 0 warnings ✔ | 1 note ✖
6+
7+
* Note 1: unable to verify current time.
8+
Time server seems to be unavailable
9+
110
## Resubmission #1 (Version 0.5.3)
211

312
This is a resubmission. In this version I put some examples for gg_doubleplot and gg_photoperiod in /dontrun to avoid long runtime. I further rebuilt the package with the latest R-devel to correct the discrepancies with Authors@R and Author field.

man/Brown_cut.Rd

Lines changed: 12 additions & 7 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/alphaopic.action.spectra.Rd

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

man/create_Timedata.Rd

Lines changed: 22 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

man/extract_clusters.Rd

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
431 Bytes
Loading

man/gg_state.Rd

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

0 commit comments

Comments
 (0)