interpolateTrack {celltrackR}R Documentation

Interpolate Track Positions

Description

Approximates the track positions at given time points using linear interpolation (via the approx function).

Usage

interpolateTrack(x, t, how = "linear")

Arguments

x

the input track (a matrix or data frame).

t

the times at which to approximate track positions. These must lie within the interval spanned by the track timepoints.

how

specifies how to perform the interpolation. Possible values are "linear" (which uses approx with default values) and "spline" (which uses spline with default values).

Value

The interpolated track (a matrix or data frame).

Examples

## Compare interpolated and non-interpolated versions of a track
bb <- boundingBox( TCells[2] )
plot( TCells[2] )
t2i <- interpolateTrack(TCells[[2]], seq(bb[1,"t"],bb[2,"t"],length.out=100),"spline")
plot( tracks( t2i ), add=TRUE, col=2 )


[Package celltrackR version 1.2.0 Index]