moving_window: Summarize data within windows of time

Description Usage Arguments Value Examples

Description

'moving_window' summarizes data within windows of a certain length.

Usage

1
moving_window(Dataframe, Trial, Window.length, FUN = mean)

Arguments

Dataframe

a GCalcium-format data frame or matrix

Trial

a single trial number

Window.length

length of time each window encompasses

FUN

a function to apply to each window

Value

a data frame with start and stop times of each window, the chronological number of each window, and summarized values

Examples

1
2
3
4
5
### Format data frame
df.new <- format_data(GCaMP)

### In trial 5, how does the average fluorescence change in 1 second time frames?
moving_window(Dataframe = df.new, Trial = 5, Window.length = 1, FUN = mean)

GCalcium documentation built on May 2, 2019, 9:31 a.m.