Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions .github/workflows/R-CMD-check.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,10 @@ jobs:
- uses: actions/setup-python@v4
if: matrix.config.python != 'debug'
with:
python-version: 3.9
python-version: 3.11

- name: setup forest
run: |
pip install git+https://github.com/onnela-lab/forest@develop
# - name: setup forest
# run: |
# pip install git+https://github.com/onnela-lab/forest@45fb41038bd46c25d9e6a4442aa74fa03b501317

- uses: r-lib/actions/check-r-package@v2
6 changes: 3 additions & 3 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
Package: walking
Title: Segments Accelerometry Data into Walking using the Python `forest` Module
Version: 0.3.2
Version: 0.4.0
Authors@R:
person(given = "John",
family = "Muschelli",
Expand All @@ -13,14 +13,14 @@ Description: Interfaces the `forest` Python
License: GPL (>= 3)
Encoding: UTF-8
Roxygen: list(markdown = TRUE)
RoxygenNote: 7.3.1
RoxygenNote: 7.3.2
Imports:
assertthat,
dplyr,
lubridate,
magrittr,
matrixStats,
reticulate,
reticulate (>= 1.4.1),
signal,
tidyr
Suggests:
Expand Down
5 changes: 0 additions & 5 deletions NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -5,11 +5,6 @@ export(estimate_steps_forest)
export(estimate_steps_sdt)
export(estimate_steps_verisense)
export(find_walking)
export(forest_requirement)
export(forest_version)
export(forest_version_pip)
export(have_forest)
export(install_forest)
export(preprocess_bout)
export(preprocess_bout_r)
export(resample_accel_data)
Expand Down
5 changes: 5 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# walking 0.4.0

* New `reticulate` initialization.
* Removing `install_forest` and the like.
* Initial CRAN submission.
2 changes: 1 addition & 1 deletion R/api.R
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
#' @rdname estimate_steps
#' @examples
#' csv_file = system.file("test_data_bout.csv", package = "walking")
#' if (requireNamespace("readr", quietly = TRUE) && walking::have_forest()) {
#' if (requireNamespace("readr", quietly = TRUE)) {
#' x = readr::read_csv(csv_file)
#' colnames(x)[colnames(x) == "UTC time"] = "time"
#' out = estimate_steps_forest(x, sample_rate_analysis = 10L)
Expand Down
2 changes: 1 addition & 1 deletion R/find_walking.R
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
#'
#' @examples
#' csv_file = system.file("test_data_bout.csv", package = "walking")
#' if (requireNamespace("readr", quietly = TRUE) && walking::have_forest()) {
#' if (requireNamespace("readr", quietly = TRUE)) {
#' x = readr::read_csv(csv_file)
#' colnames(x)[colnames(x) == "UTC time"] = "time"
#' res = find_walking(data = x)
Expand Down
80 changes: 0 additions & 80 deletions R/install_forest.R

This file was deleted.

3 changes: 2 additions & 1 deletion R/sdt.R
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,8 @@ sdt_count_steps <- function(
rm(list = c("vm", "X", "Y", "Z", "demean_vm", "filt_vm", "peak",
"HEADER_TIMESTAMP"))
location = match.arg(location, choices = c("wrist", "waist"))
threshold = ifelse(location == "wrist", 0.0267, 0.0359)
# fixed thresholds for wrist and waist May23, 2025
threshold = ifelse(location == "wrist", 0.0359, 0.0267)

data = standardize_data(data, subset = TRUE)
assertthat::assert_that(
Expand Down
2 changes: 1 addition & 1 deletion R/verisense_count_steps.R
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,7 @@ create_peak_info = function(segments) {
#'
#' @examples
#' csv_file = system.file("test_data_bout.csv", package = "walking")
#' if (requireNamespace("readr", quietly = TRUE) && walking::have_forest()) {
#' if (requireNamespace("readr", quietly = TRUE)) {
#' x = readr::read_csv(csv_file)
#' colnames(x)[colnames(x) == "UTC time"] = "time"
#' out = verisense_count_steps(x, sample_rate = 10L)
Expand Down
9 changes: 9 additions & 0 deletions R/zzz.R
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
.onLoad <- function(...) {
# ref = "v0.2"
ref = "45fb41038bd46c25d9e6a4442aa74fa03b501317"
url = "https://github.com/onnela-lab/forest"
url = paste0("git+", url)
ref = sub("^@", "", ref)
url = paste0(url, "@", ref)
reticulate::py_require(url, python_version = "3.11")
}
2 changes: 1 addition & 1 deletion man/estimate_steps.Rd

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

2 changes: 1 addition & 1 deletion man/find_walking.Rd

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

40 changes: 0 additions & 40 deletions man/forest_setup.Rd

This file was deleted.

2 changes: 1 addition & 1 deletion man/verisense_count_steps.Rd

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

5 changes: 5 additions & 0 deletions tests/testthat.R
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,9 @@
library(testthat)
library(walking)

# if (walking::have_walking_condaenv()) {
# walking::unset_reticulate_python()
# walking::use_walking_condaenv()
# }

test_check("walking")
1 change: 1 addition & 0 deletions walking.Rproj
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
Version: 1.0
ProjectId: 61f5e877-0e4c-49c6-8d46-f348ca15f168

RestoreWorkspace: No
SaveWorkspace: No
Expand Down