dispVariance {sojourner} | R Documentation

## dispVariance

### Description

calculate square displacements for all tracks in a trackll datatype, and return the variances for the dispacements of each trajectories.

### Usage

    dispVariance(trackll, min=7, plot=FALSE, limits=c(), log=FALSE,
    output=FALSE)

### Arguments

`trackll` | a list of track lists.
`min` | minimum points on trajectory, should be at least 3 to work.
`plot` | default: False, if true, show density plot for variances.
`limits` | vector of size2, variance cut-off range that one wants to plot. This will not affect the returned result.
`log` | default: False, if true, apply log10 to variance value for new spread. like limits, this will only affect the plot, not the returned value.
`output` | if True, generate a csv output for each tracklist files that are in trackll.

### Details

dispVariance applies the squareDisp function to each dataframe containing trajectories. the tracks somehow had to be converted into dataframes although they were expected to be in dataframes in the first place.

Since the tracks of shorter length are filtered out in the process, there is no guqrante that the length of tracklists equal that of the input.

The tracks should have length of at least 3, in order to have a valid displacement variance. If min argument is less than 3, the function will not be executed.

Generally, when plotting, you would want to use only one of limits or log. Although you may use both, using only one of the two would do the job.

### Value

- Variances calculated variacne for all trakcs in trackll

### Examples

    folder=system.file('extdata','SWR1',package='sojourner')
    trackll=createTrackll(folder=folder, input=3)

    # run dispVariance with default minimum tracklength (min=7)
    dispVars = dispVariance(trackll)

    # run dispVariance by setting the minimum tracklength to 3
    dispVars = dispVariance(trackll, min=3)

    # display plot only within certain range
    dispVariance(trackll, plot=TRUE, limits = c(0,0.002))

    # display plot with log-scale applied
    dispVars = dispVariance(trackll, min=3, plot=TRUE, log=TRUE)

    # display plot. Could get csv files if output = TRUE
    dispVars = dispVariance(trackll, min=3, plot=TRUE, output=FALSE)

[Package sojourner version 1.0.2 Index]