mySpline: mySpline

Description Usage Arguments Details Value Examples

View source: R/utils.R

Description

Interpolate points of a trajectory by spline. Returns the interpolated points along with the data in a single trajectory.

Usage

1
mySpline(x, y, n)

Arguments

x, y

vectors giving the coordinates of the points to be interpolated.

n

interpolation takes place at n equally spaced points spanning the interval [xmin, xmax]

Details

Spline interpolation is made according to stats::spline. See doc for details and default.

Value

A list containing components x and y which give the ordinates where interpolation took place and the interpolated values.

Examples

1
2
3
4
x <- sin(seq(0,5,0.75))
x_spline <- mySpline(seq_along(x), x, 3*length(x))
plot(seq_along(x), x)
plot(x_spline$x, x_spline$y, type = 'b')

majpark21/TSexploreR documentation built on Oct. 16, 2019, 2:46 p.m.