Learn R Programming

pastecs (version 1.0-2)

match.tol: Determine matching observation with a tolerance in time-scale

Description

Determine which observations in a regular time series match observation in an original irregular one, accepting a given tolerance window in the time-scale. This function is internally used for regulation (functions regul(), regul.screen() and regul.adj()

Usage

match.tol(x, table, nomatch=NA, tol.type="both", tol=0)

Arguments

x
a numerical vector containing seeked values (time-scale of the regular series)
table
a numerical vector containing initial times to look for match in x
nomatch
the symbol tu use to flag an entry where no match is found. By default, nomatch=NA
tol.type
the type of adjustment to use for the time-tolerance: "left", "right", "both" (by default) or "none". If tol.type="left", corresponding x values are seeked in a window ]table-to
tol
the tolerance in the time-scale to determine if a value in x matches a value in table. If tol=0, observations in each respective series must match exactly, otherwise observations in the regulated series are interpola

Value

  • a vector of the same length of x, indicating the position of the matching observations in table

See Also

regul, regul.screen, regul.adj

Examples

Run this code
X <- 1:5
Table <- c(1, 3.1, 3.8, 4.4, 5.1, 6)
match.tol(X, Table)
match.tol(X, Table, tol=0.2)
match.tol(X, Table, tol=0.55)

Run the code above in your browser using DataLab