moving_window {GCalcium}R Documentation

Summarize data within windows of time

Description

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

Usage

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

### 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)

[Package GCalcium version 1.0.0 Index]