Learn R Programming

cumplyr (version 0.1-1)

cumddply: Cumulative ddply

Description

Cumulative ddply

Usage

cumddply(data, equality.variables, inequality.variables, func)

Arguments

data
Data to process
equality.variables
Character vector variables used to split data on equality
inequality.variables
Character vector variables used to split data on inequality
func
Function to call on each split of the data

Value

Data frame with cumulative results combined across splits

Examples

Run this code
library('cumplyr')

data(rt.data)

results <- cumddply(rt.data,
                    c('Subject', 'Block'),
                    c('Trial'),
                    function (df) {with(df, mean(RT))})

print(results)

Run the code above in your browser using DataLab