distanceSteps {celltrackR}R Documentation

Distance between Two Steps

Description

Compute the distance between two steps in the dataset that occur at the same timepoint. The distance is the distance between the step starting points.

Usage

distanceSteps(X, trackids, t, quietly = FALSE)

Arguments

X

a tracks object

trackids

a vector of two indices specifying the tracks to get steps from, or a dataframe/matrix of two columns (where every row contains a pair of trackids to compute a step angle for)

t

the timepoint at which the steps should start, or a vector of such timepoints if multiple step pairs are supplied in trackids.

quietly

logical; should a warning be returned if one or both of the steps are missing in the data and the function returns NA?

Value

A single distance (NA if the desired timepoint is missing for one or both of the tracks), or a vector of such distances if multiple step pairs are supplied in trackids.

See Also

angleSteps to compute the angle between the steps, timePoints to list all timepoints in a dataset, and AngleAnalysis for other methods to compute angles and distances.

Examples

## Find the distance between the steps of the tracks with ids 1 and 3, at the 3rd
## timepoint in the dataset.
t <- timePoints( TCells )[3]
distanceSteps( TCells, c("1","3"), t )

## Do this for multiple pairs and times at once: between cells 1 and 3 at the
## 3rd timepoint, and between 1 and 4 at the fourth timepoint.
pairs <- data.frame( cell1 = c("1","1"), cell2 = c("3","4"))
times <- timePoints(TCells)[3:4]
distanceSteps( TCells, pairs, times )

[Package celltrackR version 1.2.0 Index]