Skip to content

Commit ca85fde

Browse files
Issue68 calibration (#66)
Fixes #63 => Implemented tryCatch to calibration routine
2 parents 04e19f8 + 68a35d0 commit ca85fde

File tree

2 files changed

+5
-1
lines changed

2 files changed

+5
-1
lines changed

NEWS.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
* Documentation: minor revision of documentation for functions check_classifier and getBout #41
77
* Reading data: minor revision of ReadAndCalibrate when reading ActiGraph devices with the Idle Sleep Mode activated #58
88
* Feature extraction: numeric features are no longer rounded to 3 decimal places #61
9+
* Calibration: trycatch function applied to calibration routine for cases in which coefficients cannot be retrieved #63
910

1011
# actimetric 0.1.3
1112

R/ReadAndCalibrate.R

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -88,10 +88,13 @@ ReadAndCalibrate = function(file, sf, blocksize, blocknumber, inspectfileobject,
8888
calCoefs = vm.error.st = vm.error.end = NULL
8989
if (do.calibration == TRUE & iteration == 1) {
9090
accCols = which(colnames(data) %in% c("x","y","z"))
91-
cal = calibrateRaw(data[, accCols], sf = sf, verbose = verbose)
91+
cal = try(calibrateRaw(data[, accCols], sf = sf, verbose = verbose),silent = T)
92+
9293
if (is.list(cal)) {
9394
calCoefs = cal$calCoefs; vm.error.st = cal$vm.error.st;
9495
vm.error.end = cal$vm.error.end
96+
} else{
97+
calCoefs = list(offset = c(0,0,0), scale = c(1, 1, 1))
9598
}
9699
}
97100
# -------------------------------------------------------------------------

0 commit comments

Comments
 (0)