View source: R/angle-functions.R
distanceSteps | R Documentation |
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.
distanceSteps(X, trackids, t, quietly = FALSE)
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 |
quietly |
logical; should a warning be returned if one or both of the steps are missing in the data and the function returns NA? |
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
.
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.
## 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 )
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.