papply: Parallel Apply

Description Usage Arguments Details Author(s) See Also

View source: R/papply.R

Description

Parallel apply function is used to perform the same operation over all the elements of data objects like matrices, or lists. This function provides a parallel implementation of both the apply() and lapply() functions from the core of the R programming language. The papply() function only accepts matrices or lists of matrices as input data objects.

Usage

1
papply(data, fun, margin = 1, out_filename = NULL)

Arguments

data

input data matrix or list of matrices

fun

function to be applied

margin

vector indicating which elements of the matrix the function will be applied to. The default value is 1 and indicates the rows, 2 indicates the columns and the parameter is ignored if data is a list.

out_filename

string, not used at present.

Details

The function to be applied can be supplied to papply() either as a function name or as a function definition. When only the function name is provided, the package implementing the function has to be loaded before the SPRINT library is initialised in order to ensure that the name is recognised by all the processes involved in the computation.

Note that papply() does not fully implement lapply functionality. It will only accept lists of matrices, and not lists made up of other data types.

N.B. Please see the SPRINT User Guide for how to run the code in parallel using the mpiexec command.

Author(s)

University of Edinburgh SPRINT Team sprint@ed.ac.uk www.r-sprint.org

See Also

apply lapply ff SPRINT


sprint documentation built on May 30, 2017, 8:25 a.m.

Related to papply in sprint...