Learn R Programming

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

ParallelLogger

ParallelLogger is part of the OHDSI Methods Library.

Introduction

An R package with tools to be used in the other OHDSI R packages

Features

  • Functions for parallel computation
  • Functions for logging
  • Functions used for automating analyses

Examples

# Run a function in parallel:
fun <- function(x) {
  return (x^2)
}

cluster <- makeCluster(numberOfThreads = 3)
result <- clusterApply(cluster, 1:10, fun)
stopCluster(cluster)

# Create a file logger:
addDefaultFileLogger("log.txt")
logTrace("Hello world")

Technology

ParallelLogger is an R package.

System Requirements

Requires R (version 3.1.0 or higher)

Getting Started

In R, to install the latest stable version, install from CRAN:

install.packages("ParallelLogger")

To install the latest development version, install from GitHub:

install.packages("devtools")
devtools::install_github("ohdsi/ParallelLogger")

User Documentation

Support

  • Developer questions/comments/feedback: OHDSI Forum
  • We use the GitHub issue tracker for all bugs/issues/enhancements

License

ParallelLogger is licensed under Apache License 2.0

Development

ParallelLogger is being developed in R Studio.

Development status

Ready for use

Acknowledgements

  • This project is supported in part through the National Science Foundation grant IIS 1251151.

Copy Link

Version

Install

install.packages('ParallelLogger')

Monthly Downloads

2,795

Version

1.1.1

License

Apache License 2.0

Issues

Pull Requests

Stars

Forks

Maintainer

Martijn Schuemie

Last Published

October 30th, 2019

Functions in ParallelLogger (1.1.1)

createFileAppender

Create file appender
layoutParallel

Logging layout for parallel computing
launchLogViewer

Launch the log viewer Shiny app
layoutTimestamp

Logging layout with timestamp
layoutEmail

Logging layout for e-mail
layoutStackTrace

Logging layout with stacktrace
matchInList

In a list of object of the same type, find those that match the input
logDebug

Log a message at the DEBUG level
createLogger

Create a logger
loadSettingsFromJson

Load a settings object from a JSON file
createArgFunction

Create an argument function
registerLogger

Register a logger
stopCluster

Stop the cluster
logFatal

Log a message at the FATAL level
logError

Log a message at the ERROR level
unregisterLogger

Unregister a logger
layoutSimple

Simple logging layout
getLoggers

Get all registered loggers
excludeFromList

Exclude variables from a list of objects of the same type
makeCluster

Create a cluster of nodes for parallel computation
logWarn

Log a message at the WARN level
saveSettingsToJson

Save a settings object as JSON file
logTrace

Log a message at the TRACE level
selectFromList

Select variables from a list of objects of the same type
logInfo

Log a message at the INFO level
createEmailAppender

Create e-mail appender
createConsoleAppender

Create console appender
addDefaultConsoleLogger

Add the default console logger
convertJsonToSettings

Converts a JSON string to a settings object
ParallelLogger

ParallelLogger
clusterRequire

Require a package in the cluster
convertSettingsToJson

Convert a settings object to a JSON string
addDefaultFileLogger

Add the default file logger
addDefaultEmailLogger

Add the default e-mail logger
clearLoggers

Remove all registered loggers
clusterApply

Apply a function to a list using the cluster