Learn R Programming

GENEAcore (version 1.1.2)

step_counter: Step Counter

Description

Function to calculate the number and variance of the steps in the data.

Usage

step_counter(
  step_data,
  sample_frequency = 100,
  filter_order = 2,
  boundaries = c(0.5, 5),
  Rp = 3,
  hysteresis = 0.05,
  fun = c("GENEAcount", "mean", "sd", "stepdiff")
)

stepCounter(...)

Value

Returns a vector with length fun.

Arguments

step_data

The data to use for calculating the steps. This should be a vector of acceleration values.

sample_frequency

The sampling frequency of the data, in hertz, when calculating the step number (default 100).

filter_order

single integer, order of the Chebyshev bandpass filter, passed to argument n of cheby1.

boundaries

length 2 numeric vector specifying lower and upper bounds of Chebychev filter (default c(0.5, 5) Hz), passed to argument W of butter or cheby1.

Rp

the decibel level that the cheby filter takes, see cheby1.

hysteresis

The hysteresis applied after zero crossing. (default 100mg)

fun

character vector naming functions by which to summarize steps. "count" is an internally implemented summarizing function that returns step count.

...

Additional arguments passed to internal aggregation functions.

Examples

Run this code
d1 <- sin(seq(0.1, 100, 0.1)) / 2 + rnorm(1000) / 10 + 1
Steps4 <- step_counter(d1)
length(Steps4)
mean(Steps4)
sd(Steps4)
plot(Steps4)

Run the code above in your browser using DataLab