reintegrate: Reintegrate a data stream

Description Usage Arguments Examples

View source: R/Reintegrate.R

Description

Reintegrate a data stream

Usage

1
2
reintegrate(ag, to, time_var = "Timestamp", direction = c("forwards",
  "backwards"), verbose = FALSE)

Arguments

ag

A data frame to reintegrate

to

The epoch length desired. Starting epoch length will be determined automatically.

time_var

The name of the column containing POSIX-formatted timestamp information

direction

The direction of reintegration, i.e. whether a timestamp refers to the timespan after the previous data point ("backwards"), or before the next data point ("forwards").

verbose

logical. Print updates to console?

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
data("imu_to_check", package = "AGread")
ag <-
  imu_to_check[ ,c("Timestamp", "mean_abs_Gyroscope_x_DegPerS")]

# Forwards reintegration
  reintegrate(
    ag = ag,
    to = 60,
    time_var = "Timestamp",
    direction = c("forwards")
  )

# Backwards reintegration
  reintegrate(
    ag = ag,
    to = 60,
    time_var = "Timestamp",
    direction = c("backwards")
  )
## Not run: 
# Erronious usages that will give a warning
  reintegrate(
    ag = ag,
    to = 60,
    time_var = "Timestamp",
    direction = c("forwards", "backwards")
  )

  reintegrate(
    ag = ag,
    to = 60,
    time_var = "Timestamp"
  )

## End(Not run)

AGread documentation built on Feb. 26, 2020, 5:12 p.m.