Skip to content

Commit

Permalink
Merge branch 'master' into issues_1082Date_1089NotWorn
Browse files Browse the repository at this point in the history
  • Loading branch information
vincentvanhees committed Jun 4, 2024
2 parents 59f27a9 + ed9c373 commit f07718d
Show file tree
Hide file tree
Showing 154 changed files with 367 additions and 558 deletions.
4 changes: 2 additions & 2 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
Package: GGIR
Type: Package
Title: Raw Accelerometer Data Analysis
Version: 3.1-0
Date: 2024-05-06
Version: 3.1-1
Date: 2024-06-04
Authors@R: c(person("Vincent T","van Hees",role=c("aut","cre"),
email="[email protected]"),
person("Jairo H","Migueles",role="aut",
Expand Down
9 changes: 8 additions & 1 deletion NEWS.md
Original file line number Diff line number Diff line change
@@ -1,14 +1,21 @@
# CHANGES IN GGIR VERSION 3.1-1

- Part 2: Corrected calculation of LXhr and MXhr which had one hour offset when timing was after midnight, #1117
- Fixes reversion of reading `.csv.gz` files #1131.

- Part 1: Fixes reversion of reading `.csv.gz` files #1131.

- Loading GGIR: Stops interactive calling of `chooseCRANmirror` on `.onAttach` if interactive and CRAN mirror not set #1141.

- Part 4: Corrected documentation for parameter relyonguider.

- Part 3 and 4: Revise NotWorn algorithm to work with both count and raw data with varying degrees of nonwear.

- Visualreport: Improve handling of recordings where the accelerometer was not worn.

- Part 4: Ignore empty sleeplog columns, which are sometimes accidentally created the user. GGIR can now handle these. #1138

- Part 4 report: Bug fixed causing night_part4 column to not be used #1142.

- Part 5: Fix incorrect calendar date when window starts 5 seconds before midnight, #1082

# CHANGES IN GGIR VERSION 3.1-0
Expand Down
3 changes: 2 additions & 1 deletion R/g.loadlog.R
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ g.loadlog = function(loglocation = c(), coln1 = c(), colid = c(),
# Load sleep log data...
S = data.table::fread(file = loglocation, stringsAsFactors = FALSE, data.table = FALSE,
check.names = TRUE, colClasses = "character")
S = Filter(function(x)!all(x == ""), S) # remove empty columns
nnights = (ncol(S) - coln1 + 1) / 2
cnt_time_notrecognise = 0
advanced_sleeplog = length(grep(pattern = "date", x = colnames(S), ignore.case = TRUE)) > 0
Expand Down Expand Up @@ -216,7 +217,7 @@ g.loadlog = function(loglocation = c(), coln1 = c(), colid = c(),
warning(paste0("\nWe see an odd number of timestamp columns",
" in the sleeplog. The last column will be ignored. If this is incorrect,",
" please check that argument coln1 is correctly specified if you use a basic sleeplog format and",
" that all days have a date column if you use an advanced sleeplog format."))
" that all days have a date column if you use an advanced sleeplog format."), call. = FALSE)
nnights = floor(nnights)
}
nnights = nnights + deltadate + 1 # to account for the possibility of extra night at the beginning of recording
Expand Down
3 changes: 3 additions & 0 deletions R/g.report.part4.R
Original file line number Diff line number Diff line change
Expand Up @@ -194,6 +194,9 @@ g.report.part4 = function(datadir = c(), metadatadir = c(), loglocation = c(),
if (length(data_cleaning_file) > 0) {
DaCleanFile = data.table::fread(data_cleaning_file, data.table = FALSE)
if ("night_part4" %in% colnames(DaCleanFile)) {
if (inherits(x = nightsummary$night, "character")) {
nightsummary$night = as.numeric(gsub(pattern = " ", replacement = "", x = nightsummary$night))
}
days2exclude = which(nightsummary$ID %in% DaCleanFile$ID & nightsummary$night %in% DaCleanFile$night_part4)
if (length(days2exclude) == 0 & inherits(x = nightsummary$ID, "character")) {
# Try again by now attempt to read ID as numeric
Expand Down
13 changes: 12 additions & 1 deletion R/zzz.R
Original file line number Diff line number Diff line change
@@ -1,6 +1,17 @@
.onAttach <- function(...) {
if (!interactive()) return()
pkgs <- available.packages()
# stop interactive calling from `library(GGIR)`
repos = getOption("repos")
if ("@CRAN@" %in% repos) {
repos = utils::getCRANmirrors()
# choose cloud/first if option triggers `contrib.url`
# to call `chooseCRANmirror`
repos = repos$URL[1]
packageStartupMessage(
"No CRAN mirror set, so using ", repos,
" to check GGIR package version")
}
pkgs <- available.packages(repos = repos)
cran_version <- package_version(pkgs[which(pkgs[,1] == "GGIR"),"Version"])
local_version <- packageVersion("GGIR")
behind_cran <- cran_version > local_version
Expand Down
3 changes: 3 additions & 0 deletions _pkgdown.yml
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,10 @@ navbar:
right: [search, github, twitter]

news:
cran_dates: TRUE
releases:
- text: "Version 3.1-0"
href: https://www.accelting.com/updates/ggir-release-3-1-0/
- text: "Version 3.0-0"
href: https://www.accelting.com/updates/ggir-release-3-0-0/
- text: "Version 2.9-0"
Expand Down
3 changes: 2 additions & 1 deletion docs/404.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion docs/CODE_OF_CONDUCT.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion docs/CONTRIBUTING.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion docs/LICENSE-text.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 2 additions & 1 deletion docs/RELEASE_CYCLE.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

5 changes: 3 additions & 2 deletions docs/articles/CutPoints.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 2 additions & 4 deletions docs/articles/ExternalFunction.html

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit f07718d

Please sign in to comment.