Skip to content

Commit

Permalink
Use package 'rutils' in place of 'gutils'
Browse files Browse the repository at this point in the history
  • Loading branch information
danielvartan committed Sep 26, 2023
1 parent 8ff2c68 commit 2fb2ac8
Show file tree
Hide file tree
Showing 6 changed files with 17 additions and 44 deletions.
32 changes: 0 additions & 32 deletions .github/workflows/lint.yaml

This file was deleted.

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# See https://git-scm.com/docs/gitignore
# Created by https://www.toptal.com/developers/gitignore/api/r
# Edit at https://www.toptal.com/developers/gitignore?templates=r

Expand Down
12 changes: 6 additions & 6 deletions DESCRIPTION
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,20 @@ License: MIT + file LICENSE
URL: https://giperbio.github.io/actverse/, https://github.com/giperbio/actverse/
BugReports: https://github.com/giperbio/actverse/issues
Depends:
R (>= 4.1)
R (>= 4.2)
Imports:
checkmate (>= 2.1.0),
cli (>= 3.6.0),
dplyr (>= 1.1.0),
ggplot2 (>= 3.4.1),
gutils,
hms (>= 1.1.2),
lifecycle (>= 1.0.3),
lubridate (>= 1.9.2),
magrittr (>= 2.0.3),
purrr (>= 1.0.1),
rlang (>= 1.0.6),
stats (>= 4.1.0),
rutils,
stats (>= 4.2.0),
tsibble (>= 1.1.3),
viridis (>= 0.6.2)
Suggests:
Expand All @@ -79,11 +79,11 @@ Suggests:
suncalc (>= 0.5.1),
testthat (>= 3.1.6),
tibble (>= 3.1.8),
tools (>= 4.1.0),
utils (>= 4.1.0),
tools (>= 4.2.0),
utils (>= 4.2.0),
zoo (>= 1.8-11)
Remotes:
github::giperbio/gutils
github::danielvartan/rutils
VignetteBuilder:
knitr
Config/testthat/edition: 3
Expand Down
8 changes: 4 additions & 4 deletions R/read_acttrust.R
Original file line number Diff line number Diff line change
Expand Up @@ -239,7 +239,7 @@ validate_acttrust_data <- function(data, regularize = TRUE) {
out <- out %>%
dplyr::mutate(dplyr::across(
!dplyr::matches("^timestamp$|^state$"),
~ dplyr::if_else(state == 4, gutils::na_as(.x), .x)))
~ dplyr::if_else(state == 4, rutils::na_as(.x), .x)))

offwrist_ints <- find_offwrist_intervals(out)

Expand All @@ -258,11 +258,11 @@ validate_acttrust_data <- function(data, regularize = TRUE) {
)) %>%
dplyr::mutate(dplyr::across(
!dplyr::matches("^timestamp$|^orientation$"),
~ dplyr::if_else(.x < 0, gutils::na_as(.x), .x)
~ dplyr::if_else(.x < 0, rutils::na_as(.x), .x)
)) %>%
dplyr::mutate(dplyr::across(
dplyr::ends_with("_temperature"),
~ dplyr::if_else(.x >= 100, gutils::na_as(.x), .x)
~ dplyr::if_else(.x >= 100, rutils::na_as(.x), .x)
))
}

Expand Down Expand Up @@ -295,7 +295,7 @@ regularize_acttrust_data <- function(data) {
aggregate_index(epoch_unit) %>%
dplyr::mutate(dplyr::across(
!dplyr::matches("^timestamp$"),
~ dplyr::if_else(is.nan(.x), gutils::na_as(.x), .x)
~ dplyr::if_else(is.nan(.x), rutils::na_as(.x), .x)
))

count_gaps <- tsibble::count_gaps(out) %>%
Expand Down
6 changes: 5 additions & 1 deletion R/write_acttrust.R
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ write_acttrust <- function(data, file, delim = ";", header = NULL) {

# R CMD Check variable bindings fix (see: https://bit.ly/3z24hbU)
# nolint start: object_usage_linter.
acttrust <- acttrust
acttrust <- NULL
. <- NULL
timestamp <- date <- time <- ms <- NULL
pim <- pim_n <- tat <- tat_n <- zcm <- zcm_n <- NULL
Expand All @@ -75,6 +75,10 @@ write_acttrust <- function(data, file, delim = ";", header = NULL) {
event <- state <- NULL
# nolint end

utils::data(
"acttrust", package = "actverse", envir = environment()
)

epoch <- find_epoch(data)$best_match
cols <- paste0("^timestamp$|^", tsibble::index2_var(data), "$") %>%
grep(names(acttrust), value = TRUE, invert = TRUE)
Expand Down
2 changes: 1 addition & 1 deletion actverse.Rproj
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ AlwaysSaveHistory: Default

EnableCodeIndexing: Yes
UseSpacesForTab: Yes
NumSpacesForTab: 4
NumSpacesForTab: 2
Encoding: UTF-8

RnwWeave: Sweave
Expand Down

0 comments on commit 2fb2ac8

Please sign in to comment.