stepCounter: Step Counter

View source: R/stepCounter.R

stepCounterR Documentation

Step Counter

Description

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

Usage

stepCounter(
  AccData,
  samplefreq = 100,
  filterorder = 2,
  boundaries = c(0.5, 5),
  Rp = 3,
  plot.it = FALSE,
  hysteresis = 0.05,
  verbose = verbose,
  fun = c("GENEAcount", "mean", "sd", "mad")
)

Arguments

AccData

The data to use for calculating the steps. This should either an AccData object or a vector.

samplefreq

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

filterorder

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.

plot.it

single logical create plot of data and zero crossing points (default FALSE).

hysteresis

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

verbose

single logical should additional progress reporting be printed at the console? (default FALSE).

fun

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

Value

Returns a vector with length fun.

Examples

d1 <- sin(seq(0.1, 100, 0.1))/2 + rnorm(1000)/10 + 1
Steps4 = stepCounter(d1)
length(Steps4)
mean(Steps4)
sd(Steps4)
plot(Steps4)

GENEAclassify documentation built on March 31, 2023, 9:01 p.m.