Skip to content

Commit 7e2577e

Browse files
committed
Change state_prop() default value for state_values to include both sleeping and resting states
1 parent 00ae620 commit 7e2577e

3 files changed

Lines changed: 6 additions & 5 deletions

File tree

‎NEWS.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
- `sri()` now `min_data` as an argument, which specifies the minimum proportion of non-missing values required to compute the SRI for each time point. If the proportion of non-missing values is below this threshold, the SRI will be set to `NA` for that time point. This helps to avoid computing the SRI when there is insufficient data.
55
- `sri()` now returns a `valid_data` column, which indicates the proportion of non-missing values in the `agreement` column for each time point. This provides additional information about the data quality used to compute the SRI.
66
- `sri()` now has different default values for `sleeping_states` and `awake_states`. The new defaults are `sleeping_states = c(1, 2)` and `awake_states = 0`. The previous defaults were `sleeping_states = 1` and `awake_states = c(0, 2)`, which considered *resting* states as awake, differing from the way that the index was originally computed.
7+
- `state_prop()` now has a default value of `c(1, 2)` for `state_values`, which considers both *sleeping* and *resting* states (for Condor Instruments actigraphy data) as the target states for calculating the proportion. The previous default was `1`, which only considered the *sleeping* state.
78

89
# actverse 0.1.0
910

‎R/state_prop.R‎

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
#' @param state_values (optional) An
1414
#' [`integerish`][checkmate::assert_integerish] vector indicating which state
1515
#' values are considered as the target state(s) for calculating the proportion
16-
#' (default: `1`).
16+
#' (default: `c(1, 2)`).
1717
#'
1818
#' @return A [`tsibble`][tsibble::tsibble()] object with the following columns:
1919
#'
@@ -42,7 +42,7 @@
4242
#' )
4343
#'
4444
#' data <- read_acttrust(file, tz = "America/Sao_Paulo")
45-
#' state_prop_data <- data |> state_prop(state_values = 1) # Sleeping state
45+
#' state_prop_data <- data |> state_prop() # Sleeping + Resting states
4646
#'
4747
#' state_prop_data |> print()
4848
#'
@@ -75,7 +75,7 @@
7575
state_prop <- function(
7676
data,
7777
state_col = "state",
78-
state_values = 1
78+
state_values = c(1, 2)
7979
) {
8080
assert_tsibble(data)
8181
assert_regularity(data, strict = TRUE)

‎man/state_prop.Rd‎

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

0 commit comments

Comments
 (0)