Title: Apply Functions to Multiple Multidimensional Arrays or Vectors
Version: 2.0.0
Authors@R: c(
Version: 2.0.1
Authors@R: c(
person("BSC-CNS", role = c("aut", "cph")),
person("Nicolau", "Manubens", , "nicolau.manubens@bsc.es", role = "aut"),
person("Alasdair", "Hunter", , "alasdair.hunter@bsc.es", role = "aut"),
person("Nuria", "Perez", , "nuria.perez@bsc.es", role = "cre"))
Description: The base apply function and its variants, as well as the related functions in the 'plyr' package, typically apply user-defined functions to a single argument (or a list of vectorized arguments in the case of mapply). The 'multiApply' package extends this paradigm with its only function, Apply, which efficiently applies functions taking one or a list of multiple unidimensional or multidimensional numeric arrays (or combinations thereof) as input. The input arrays can have different numbers of dimensions as well as different dimension lengths, and the applied function can return one or a list of unidimensional or multidimensional arrays as output. This saves development time by preventing the R user from writing often error-prone and memory-unefficient loops dealing with multiple complex arrays. Also, a remarkable feature of Apply is the transparent use of multi-core through its parameter 'ncores'. In contrast to the base apply function, this package suggests the use of 'target dimensions' as opposite to the 'margins' for specifying the dimensions relevant to the function to be applied.
Description: The base apply function and its variants, as well as the related
functions in the 'plyr' package, typically apply user-defined functions to a
single argument (or a list of vectorized arguments in the case of mapply). The
'multiApply' package extends this paradigm with its only function, Apply, which
efficiently applies functions taking one or a list of multiple unidimensional
or multidimensional numeric arrays (or combinations thereof) as input. The input
arrays can have different numbers of dimensions as well as different dimension
lengths, and the applied function can return one or a list of unidimensional or
multidimensional arrays as output. This saves development time by preventing the
R user from writing often error-prone and memory-inefficient loops dealing with
multiple complex arrays. Also, a remarkable feature of Apply is the transparent
use of multi-core through its parameter 'ncores'. In contrast to the base apply
function, this package suggests the use of 'target dimensions' as opposite
to the 'margins' for specifying the dimensions relevant to the function to be
This package includes the function `Apply` as its only function. It extends the `apply` function to applications in which a function needs to be applied simultaneously over multiple input arrays. Although this can be done manually with for loops and calls to the base `apply` function, it can often be a challenging task which can easily result in error-prone or memory-unefficient code.
This package includes the function `Apply` as its only function. It extends the `apply` function to applications in which a function needs to be applied simultaneously over multiple input arrays. Although this can be done manually with for loops and calls to the base `apply` function, it can often be a challenging task which can easily result in error-prone or memory-inefficient code.
A very simple example follows showing the kind of situation where `Apply` can be useful: imagine you have two arrays, each containing five 2x2 matrices, and you want to perform the multiplication of each of the five pairs of matrices. Next, one of the best ways to do this with base R (plus some helper libraries):