Description Usage Arguments Details Value Author(s) See Also Examples
View source: R/rateEvolution.R
rateEvolution
evaluates and plot.rateEvolution
plots the
firing rate evolution of a spikeTrain
object. The evaluation is
done by convolving the spike train with a kernel like in
density
estimation.
1 2 3 4 5 6 7 |
x |
a |
bw |
the kernel bin width in seconds. If |
kernel |
see |
n |
see |
from |
see |
to |
see |
na.rm |
see |
main |
see |
xlab |
see |
ylab |
see |
type |
see |
zero.line |
see |
... |
see |
rateEvolution
is mainly a wrapper for density
which also adjusts the result of the latter such that the y component
of the returned list is an instantaneous firing rate. If the length of
x
is smaller or equal to 1 and if from
or
to
is (are) missing
the returned object has then each of its
components set to NA
except data.name
(see below). If
the length of x
is smaller or equal to 1 and if both
from
and to
are specified a missing
bw
is
then set to 3 times the spacing between the points of the regular grid
on which the density is evaluated.
plot.rateEvolution
is also a wrapper for
plot.density
which only adjust the default value of some arguments.
rateEvolution
returns a LIST of class rateEvolution
which inherits from class density
.
x |
the |
y |
the estimated rate (in 1/s). These will be non-negative, but can be zero. |
bw |
the bandwidth used. |
n |
the sample size after elimination of missing values. |
call |
the call which produced the result. |
data.name |
the deparsed name of the |
has.na |
logical, for compatibility (always |
plot.rateEvolution
is called for its side effect: a plot is generated.
Christophe Pouzat christophe.pouzat@gmail.com
as.spikeTrain
,
density
,
plot.density
,
mkREdf
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 | ## load Purkinje cell data recorded in cell-attached mode
data(sPK)
## coerce sPK to a spikeTrain object
sPK <- lapply(sPK, as.spikeTrain)
## get the rate evolution in ctl condition
sPKreCTL <- rateEvolution(sPK[["ctl"]])
## plot the result
plot(sPKreCTL)
## check the bin width which was actually used
sPKreCTL$bw
## look at the effect of a 10 times larger bw
plot(rateEvolution(sPK[["ctl"]],bw=10*sPKreCTL$bw))
## look at the effect of a 10 times smaller one
plot(rateEvolution(sPK[["ctl"]],bw=sPKreCTL$bw/10))
## get the rate evolution in bicuculline conditions
sPKreBICU <- rateEvolution(sPK[["bicu"]])
## plot results
plot(sPKreBICU,col=2)
## add the ctl rate evolution
lines(sPKreCTL)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.