drLapply: Apply a function to all key-value pairs of a ddo/ddf object

Description Usage Arguments Value Author(s) See Also Examples

Description

Apply a function to all key-value pairs of a ddo/ddf object and get a new ddo object back, unless a different combine strategy is specified.

Usage

1
2
drLapply(X, FUN, combine = combDdo(), output = NULL, overwrite = FALSE,
  params = NULL, packages = NULL, control = NULL, verbose = TRUE)

Arguments

X

an object of class "ddo" of "ddf"

FUN

a function to be applied to each subset

combine

optional method to combine the results

output

a "kvConnection" object indicating where the output data should reside (see localDiskConn, hdfsConn). If NULL (default), output will be an in-memory "ddo" object.

overwrite

logical; should existing output location be overwritten? (also can specify overwrite = "backup" to move the existing output to _bak)

params

a named list of objects external to the input data that are needed in the distributed computing (most should be taken care of automatically such that this is rarely necessary to specify)

packages

a vector of R package names that contain functions used in fn (most should be taken care of automatically such that this is rarely necessary to specify)

control

parameters specifying how the backend should handle things (most-likely parameters to rhwatch in RHIPE) - see rhipeControl and localDiskControl

verbose

logical - print messages about what is being done

Value

depends on combine

Author(s)

Ryan Hafen

See Also

recombine, drFilter, drJoin, combDdo, combRbind

Examples

1
2
bySpecies <- divide(iris, by = "Species")
drLapply(bySpecies, function(x) x$Sepal.Width)

Example output

*** finding global variables used in 'fn'... [none]
*** testing 'fn' on a subset... ok
* Applying recombination...

Distributed data object backed by 'kvMemory' connection

 attribute      | value
----------------+----------------------------------------------------------------
 size (stored)  | 4.34 KB
 size (object)  | 4.34 KB
 # subsets      | 3

* Other attributes: getKeys()
* Missing attributes: splitSizeDistn

datadr documentation built on May 1, 2019, 8:06 p.m.