Description Usage Arguments Details Value Note Author(s) See Also Examples
View source: R/rateEvolution.R
Given a list of spikeTrain
or repeatedTrain
objects
mkREdf
evaluates the rate evolution of each train and returns a
data frame suitable for use with coplot
, xyplot
and qplot
.
1 2 3 4 |
x |
a named list of |
longitudinal |
a |
across |
a |
bw |
see |
kernel |
see |
n |
see |
from |
see |
to |
see |
na.rm |
see |
minusMean |
should the mean of the rate evolution along the across "dimension" be subtracted from each individual rate evolution along this dimension? |
mkREdf
calls rateEvolution
on every
spikeTrain
in x
. If from
and to
are
missing, they are internally set to the floor
of the global
minimal spike time contained in x
and to the ceiling
of
the global maximal time.
A data frame with the following variables:
time |
The time (in s) at which the rate was evaluated. |
rate |
The rate (in 1/s). |
longitudinal |
A factor corresponding to the argument with the same name. |
across |
A factor corresponding to the argument with the same name. |
argument minusMean
is now here as an "experimental"
feature. The idea is that it could be used to detect
non-stationarities of the reponses (in a repeated stimulation context)
which would be correlated across different neurons. I'm not sure yet
if this will be useful or not.
Christophe Pouzat christophe.pouzat@gmail.com
as.spikeTrain
,
as.repeatedTrain
,
data.frame
,
factor
,
rateEvolution
,
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 | ## load Purkinje cell data recorded in cell-attached mode
data(sPK)
## coerce sPK to a spikeTrain object
sPK <- lapply(sPK, as.spikeTrain)
## get a rate evolution data frame
sPKreDF <- mkREdf(sPK)
## display result using coplot
coplot(rate ~ time | longitudinal,data=sPKreDF,panel=lines,show.given=FALSE)
## Not run:
## make it prettier with with xyplot of package lattice
library(lattice)
xyplot(rate ~ time | longitudinal, data=sPKreDF,panel=panel.lines)
## if ggplot2 is installed, try it out
library(ggplot2)
qplot(time,rate,data=sPKreDF,geom="line",colour=longitudinal)
## End(Not run)
## load Purkinje cell data recorded with the NeuroNexus probes
data(mPK)
mPK <- lapply(mPK, as.repeatedTrain)
## get a rate evolution data frame
mPKreDF <- mkREdf(mPK)
## use coplot to display result
coplot(rate ~ time | longitudinal * across,data = mPKreDF,panel=lines)
## Not run:
## make it prettier with with xyplot of package lattice
library(lattice)
xyplot(rate ~ time | across,data = mPKreDF,groups=longitudinal,panel=panel.lines)
xyplot(rate ~ time | across * longitudinal,data = mPKreDF, panel=panel.lines)
## if ggplot2 is installed, try it out
library(ggplot2)
qplot(time,rate,data=mPKreDF,geom="line",colour=longitudinal,facets=across ~ .)
## End(Not run)
## another example with the CAL1V data set
data(CAL1V)
CAL1V <- lapply(CAL1V,as.repeatedTrain)
## generate the data frame specifying the longitudinal argument
## to end up with a clearer display
CAL1VreDF <- mkREdf(CAL1V,longitudinal=paste(1:20))
coplot(rate ~ time | across * longitudinal,data=CAL1VreDF,panel=lines,show.given=FALSE)
## Not run:
## if ggplot2 is installed, try it out
library(ggplot2)
qplot(time,rate,data=CAL1VreDF,geom="line",facets=longitudinal ~ across)
## End(Not run)
## another example with the CAL2C data set
data(CAL2C)
CAL2C <- lapply(CAL2C,as.repeatedTrain)
## generate the data frame specifying the longitudinal argument
## to end up with a clearer display
CAL2CreDF <- mkREdf(CAL2C,longitudinal=paste(1:20))
coplot(rate ~ time | across * longitudinal,data=CAL2CreDF,panel=lines,show.given=FALSE)
## Not run:
## if ggplot2 is installed, try it out
library(ggplot2)
qplot(time,rate,data=CAL2CreDF,geom="line",facets=longitudinal ~ across)
## End(Not run)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.