Given a list of spike trains (or a repeatedTrain object) where
each train was acquired during,
say, one presentation of a given stimulus, a raster plot is
generated. If stimulus time properties are specified, the stimulus
application time also appears on the plot.
## Load Vanillin responses data (first cockroach data set)
data(CAL1V)
## convert them into repeatedTrain objects
## The stimulus command is on between 4.49 s and 4.99s
CAL1V <- lapply(CAL1V,as.repeatedTrain)
## look at the individual raster plots
raster(CAL1V[["neuron 1"]],stimTimeCourse=c(4.49,4.99),main="N1")
plot(CAL1V[["neuron 2"]],stimTimeCourse=c(4.49,4.99),main="N2")
plot(CAL1V[["neuron 3"]],stimTimeCourse=c(4.49,4.99),main="N3")
plot(CAL1V[["neuron 4"]],stimTimeCourse=c(4.49,4.99),main="N4")
Results
R version 3.3.1 (2016-06-21) -- "Bug in Your Hair"
Copyright (C) 2016 The R Foundation for Statistical Computing
Platform: x86_64-pc-linux-gnu (64-bit)
R is free software and comes with ABSOLUTELY NO WARRANTY.
You are welcome to redistribute it under certain conditions.
Type 'license()' or 'licence()' for distribution details.
R is a collaborative project with many contributors.
Type 'contributors()' for more information and
'citation()' on how to cite R or R packages in publications.
Type 'demo()' for some demos, 'help()' for on-line help, or
'help.start()' for an HTML browser interface to help.
Type 'q()' to quit R.
> library(STAR)
Loading required package: survival
Loading required package: mgcv
Loading required package: nlme
This is mgcv 1.8-12. For overview type 'help("mgcv-package")'.
Loading required package: R2HTML
Loading required package: gss
Loading required package: codetools
> png(filename="/home/ddbj/snapshot/RGM3/R_CC/result/STAR/raster.Rd_%03d_medium.png", width=480, height=480)
> ### Name: raster
> ### Title: Generate a Raster Plot
> ### Aliases: raster plot.repeatedTrain
> ### Keywords: ts survival
>
> ### ** Examples
>
> ## Load Vanillin responses data (first cockroach data set)
> data(CAL1V)
> ## convert them into repeatedTrain objects
> ## The stimulus command is on between 4.49 s and 4.99s
> CAL1V <- lapply(CAL1V,as.repeatedTrain)
> ## look at the individual raster plots
> raster(CAL1V[["neuron 1"]],stimTimeCourse=c(4.49,4.99),main="N1")
> plot(CAL1V[["neuron 2"]],stimTimeCourse=c(4.49,4.99),main="N2")
> plot(CAL1V[["neuron 3"]],stimTimeCourse=c(4.49,4.99),main="N3")
> plot(CAL1V[["neuron 4"]],stimTimeCourse=c(4.49,4.99),main="N4")
>
>
>
>
>
> dev.off()
null device
1
>