Learn R Programming

parallelML (version 1.2)

convertAverage: Take averages over a list of data.frames

Description

Given a list of similar data.frames (same schema and dimension) or vectors (same length), create a single data.frame or vector with same dimension or length consisting of averages over the list.

Usage

convertAverage(data)

Arguments

data
A list of equally-sized data.frames or vectors

Value

A single data.frame or vector containing averages over the list.

Examples

Run this code
# Create a list of data.frames
frame1 <- data.frame(a=1:10,b=2:11)
frame2 <- data.frame(a=11:20,b=3:12)
frameList <- list(frame1,frame2)

# Take the respective averages
convertAverage(frameList)

# Create a list of vectors
vector1 <- 1:10
vector2 <- 11:20
vectorList <- list(vector1,vector2)

# Take the respective averages
convertAverage(vectorList)

Run the code above in your browser using DataLab