Learn R Programming

sprint (version 1.0.4)

papply: Parallel Apply

Description

Parallel apply function used to perform the same operation over all the elements of data objects like matrices, data frames or lists. This function provides a parallel implementation of both the apply() and lapply() functions from the core of the R programming language. This parallel implementation papply() has been extended to accept an ff object as input which allows the processing of much larger data stored on disk.

Usage

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

Arguments

data
array, list or ff object
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, name of the result file when input is an ff object

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.

See Also

apply lapply ff SPRINT