Learn R Programming

MotilityLab (version 0.2-5)

as.data.frame.tracks: Convert Tracks to Data Frame

Description

Converts tracks from the list-of-matrices format, which is good for efficient processing and therefore the default in this package, to a single dataframe which is convenient for plotting or saving the data.

Usage

"as.data.frame"(x, row.names = NULL, optional = FALSE, include.timepoint.column = FALSE, ...)

Arguments

x
the tracks object to be coerced to a data frame.
row.names
NULL or a character vector giving row names for the data frame. Missing values are not allowed.
optional
logical. Required for S3 consistency, but has no effect: column names are always assigned to the resulting data frame regardless of the setting of this option.
include.timepoint.column
logical. If set to TRUE, then the resulting dataframe will contain a column that consecutively numbers the positions according to their time. Note that this information is anyway implicitly present in the time information.
...
further arguments to be passed from or to other methods.

Value

A single data frame containing all individual tracks from the input with a prepended column named "id" containing each track's identifier in `x`.

Examples

Run this code
## Display overall average position of the T cell data
colMeans( as.data.frame( TCells )[-c(1,2)] )

Run the code above in your browser using DataLab