as.spikeTrain: Coerce, Test and Extract from spikeTrain Objects

Description Usage Arguments Details Value Author(s) References See Also Examples

View source: R/spikeTrain.R

Description

as.spikeTrain attempts to coerce a numeric vector to a spikeTrain object while is.spikeTrain tests if its argument is such an object. [.spikeTrain, extracts a subset of a spikeTrain object.

Usage

1
2
3
4
as.spikeTrain(x)
is.spikeTrain(x)
## S3 method for class 'spikeTrain'
x[i]

Arguments

x

An object to be coerced to or to test against a spikeTrain object or a spikeTrain obect for [.

i

indices specifying elements to extract. No gaps are allowed.

Details

A spikeTrain object is a numeric vector whose elements are strictly increasing (that is, something which can be interpreted as a sequence of times of successive events with no two events occurring at the same time). The extractor method, [ requires that the extracted elements are without gaps, an error is returned otherwise.

Value

as.spikeTrain returns a spikeTrain object or an error.

is.spikeTrain returns TRUE if its argument is a spikeTrain object and FALSE otherwise.

[ returns a spikeTrain object or an error.

Author(s)

Christophe Pouzat [email protected]

References

Perkel D. H., Gerstein, G. L. and Moore G. P. (1967) Neural Spike Trains and Stochastic Point Processes. I. The Single Spike Train. Biophys. J., 7: 391-418. http://www.pubmedcentral.nih.gov/articlerender.fcgi?tool=pubmed&pubmedid=4292791

See Also

plot.spikeTrain, print.spikeTrain, summary.spikeTrain

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
## load CAL1S data
data(CAL1S)
## convert the data into spikeTrain objects
CAL1S <- lapply(CAL1S,as.spikeTrain)
## Are the list eleemnts now spikeTrain objects?
sapply(CAL1S, is.spikeTrain)
## look at the train of the 1st neuron
CAL1S[["neuron 1"]]
## look at the window 10-40 using the extractor function
CAL1S[["neuron 1"]][10 < CAL1S[["neuron 1"]] & CAL1S[["neuron 1"]] < 40] 

STAR documentation built on May 31, 2017, 2:28 a.m.