Learn R Programming

STAR (version 0.3-7)

isi: Get Lagged Inter Spike Intervals (ISIs) From Data Frames Generated by mkGLMdf

Description

A utility function to create a vector containing the ith preceding inter spike interval (isi) at a given time.

Usage

isi(dataFrame, lag = 1)

Arguments

dataFrame
a data.frame typically generated by mkGLMdf. Should at least contain an event and a time variable.
lag
a strictly positive integer. Set to 1 if the previous isi is required, to 2 is the isi preceding the last one is required, etc...

Value

A numeric vector with the value of the lagth isi preceding the time of the corresponding bin center.

Details

Look at the (short) source file for details.

See Also

mkGLMdf, gssanova, %tt%

Examples

Run this code
## Not run: 
# ## load e060517spont data set
# data(e060517spont)
# ## make a data frame using a 2 ms bin width
# e060517spontDF <- mkGLMdf(e060517spont,0.002,0,60)
# ## Keep data relevant to neuron 1
# e060517spontDFn1 <- e060517spontDF[e060517spontDF$neuron == "1",]
# ## get the isi at lag 1 and 2
# e060517spontDFn1$isi1 <- isi(e060517spontDFn1,lag=1)
# e060517spontDFn1$isi2 <- isi(e060517spontDFn1,lag=2)
# ## keep only defined elements
# e060517spontDFn1 <- e060517spontDFn1[!is.na(e060517spontDFn1$isi2),]
# ## split the data set into an "early" and a "late" part
# e060517spontDFn1e <- e060517spontDFn1[e060517spontDFn1$time <= 30,]
# e060517spontDFn1l <- e060517spontDFn1[e060517spontDFn1$time > 30,]
# ## Fit the late part
# e060517spontDFn1lGF <- gssanova(event ~ lN.1*isi1+isi2, data=e060517spontDFn1l, family="binomial", seed=20061001)
# ## Time transform the early part and perform goodness of fit tests
# e060517spont.n1e.tt <- e060517spontDFn1lGF %tt% e060517spontDFn1e
# e060517spont.n1e.tt
# summary(e060517spont.n1e.tt)
# plot(summary(e060517spont.n1e.tt))
# ## End(Not run)

Run the code above in your browser using DataLab