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

Description Usage Arguments Value Examples

View source: R/data-structures.R

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

1
2
3
4
5
6
7
8
9
## S3 method for class 'tracks'
as.data.frame(
  x,
  row.names = NULL,
  optional = FALSE,
  include.timepoint.column = FALSE,
  idsAsFactors = TRUE,
  ...
)

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.

idsAsFactors

logical. If TRUE, then the id column of the resulting dataframe will be a factor column, otherwise a characeter column.

...

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

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

celltrackR documentation built on April 14, 2020, 6:42 p.m.