Learn R Programming

cycleRtools (version 1.0.0)

uniform: Create a uniform data.frame.

Description

Returns a data frame with rows that are uniformly incremented along the first column. Useful for rolling operations, whereby a rolling time window is of interest.

Usage

uniform(data, delta = NULL, verbose = TRUE, .return_delta = FALSE)

Arguments

data
a data.frame or matrix object to make uniform. This is done on the basis of the first column.
delta
the incremement by which to make the data uniform. If NULL (default) the most appropriate value is estimated.
verbose
should messages be printed to the console?
.return_delta
if TRUE the delta value is assigned to the calling environment. Intended for internal use.

Value

  • A uniform data frame. An index column is appended so that original data values can be extracted - e.g. after a rolling operation.

See Also

source code for rollmean_smth

Examples

Run this code
t_sec <- c(1:10, 20:40, 50)            # Discontinuous timer values.
pwr   <- runif(length(t_sec), 0, 400)  # Some power values.
x     <- data.frame(t_sec, pwr)
uniform(x)

Run the code above in your browser using DataLab