Learn R Programming

⚠️There's a newer version (1.3-3) of this package.Take me there.

distcomp

This package is described in detail in the paper Software for Distributed Computation on Medical Databases: A Demonstration Project.

Installation

Install this package the usual way in R or via:

{r, eval = FALSE} library(devtools) install_github("bnaras/distcomp")

Then, you will find a document that describes several examples installed under the R library tree. For example:

{r, eval = FALSE} list.files(system.file("doc", package = "distcomp")) list.files(system.file("doc_src", package = "distcomp"))

The examples described in the reference below are available as follows:

{r, eval = FALSE} list.files(system.file("ex", package = "distcomp"))

Use of this package requires some configuration. In particular, to run the examples on a local machine where a single opencpu server will be emulating several sites, a suitable R profile needs to be set up. That profile will be something along the lines of

{r, eval=FALSE} library(distcomp) distcompSetup(workspace = "full_path_to_workspace_directory", ssl_verifyhost = 0L, ssl_verifypeer = 0L) where the workspace is a directory that the opencpu server can serialize objects to. On Unix or Mac, the above can be inserted into an .Rprofile file, but on Windows, we find that the Rprofile.site file needs to contain the above lines.

The effect of this is that every R process (including the opencpu process) has access to the distcomp library and the workspace.

Prototyping New Computations

Refer to the vignette in the package for some tips on developing new distributed computations.

References

Balasubramanian Narasimhan and Daniel Rubin and Samuel Gross and Marina Bendersky and Philip Lavori. Software for Distributed Computation on Medical Databases: A Demonstration Project. Journal of Statistical Software, Volume 77, Issue 13, (2017). DOI

Copy Link

Version

Install

install.packages('distcomp')

Monthly Downloads

315

Version

1.1

License

LGPL (>= 2)

Maintainer

Balasubramanian Narasimhan

Last Published

September 23rd, 2019

Functions in distcomp (1.1)

SVDMaster

defineNewComputation

Define a new computation
resetComputationInfo

Clear the contents of the global store
SVDWorker

runDistcompApp

Run a specified distcomp web application
availableComputations

Return the currently available (implemented) computations
generateId

Generate an identifier for an object
availableDataSources

Return currently implemented data sources
getComputationInfo

Get the value of a variable from the global store
uploadNewComputation

Upload a new computation and data to an opencpu server
.makeOpencpuURL

Make an appropriate opencpu URL for a specified function and url prefix for the distcomp package
createInstanceObject

Given the definition identifier of an object, instantiate and store object in workspace
destroyInstanceObject

Destroy an instance object given its identifier
CoxWorker

writeCode

Write the code necessary to run a master process
distcomp

Distributed Computing with R
setupWorker

Setup a worker site
makeDefinition

Make a computation definition given the computation type
getConfig

Return the workspace and configuration setup values
setupMaster

Setup a computation master
saveNewComputation

Save a computation instance, given the computation definition, associated data and possibly a data file name to use
distcompSetup

Setup a workspace and configuration for a distributed computation
executeMethod

Given the id of a serialized object, invoke a method on the object with arguments
setComputationInfo

Set a name to a value in a global variable
dccoxph

Functions copied and modified from survival package
makeMaster

Make a master object given a definition
makeWorker

Make a worker object given a definition and data
CoxMaster