Package pbmcapply. August 16, 2017

Similar documents
Package pbapply. R topics documented: January 10, Type Package Title Adding Progress Bar to '*apply' Functions Version Date

Package cattonum. R topics documented: May 2, Type Package Version Title Encode Categorical Features

Package zoomgrid. January 3, 2019

Package spark. July 21, 2017

Package fastdummies. January 8, 2018

Package readxl. April 18, 2017

Package repec. August 31, 2018

Package messaging. May 27, 2018

Package dat. January 20, 2018

Package clipr. June 23, 2018

Package robotstxt. November 12, 2017

Package RPresto. July 13, 2017

Package ECctmc. May 1, 2018

Package filelock. R topics documented: February 7, 2018

Package datasets.load

Package dbx. July 5, 2018

Package sfc. August 29, 2016

Package oec. R topics documented: May 11, Type Package

Package slickr. March 6, 2018

Package sessioninfo. June 21, 2017

Package pwrab. R topics documented: June 6, Type Package Title Power Analysis for AB Testing Version 0.1.0

Package ggimage. R topics documented: November 1, Title Use Image in 'ggplot2' Version 0.0.7

Package shinyfeedback

Package reval. May 26, 2015

Package d3plus. September 25, 2017

Package xwf. July 12, 2018

Package GetoptLong. June 10, 2018

Package sankey. R topics documented: October 22, 2017

Package pinyin. October 17, 2018

Package loggit. April 9, 2018

Package utf8. May 24, 2018

Package combiter. December 4, 2017

Package ggimage. R topics documented: December 5, Title Use Image in 'ggplot2' Version 0.1.0

Package glue. March 12, 2019

Package shiny.semantic

Package humanize. R topics documented: April 4, Version Title Create Values for Human Consumption

Package bigreadr. R topics documented: August 13, Version Date Title Read Large Text Files

Package tm.plugin.lexisnexis

Package zeallot. R topics documented: September 28, Type Package

Package geogrid. August 19, 2018

Package githubinstall

Package future.apply

Package crochet. January 8, 2018

Package callr. August 29, 2016

Package darksky. September 20, 2017

Package strat. November 23, 2016

Package triebeard. August 29, 2016

Package htmltidy. September 29, 2017

Package jstree. October 24, 2017

Package rprojroot. January 3, Title Finding Files in Project Subdirectories Version 1.3-2

Package ecoseries. R topics documented: September 27, 2017

Package deductive. June 2, 2017

Package spelling. December 18, 2017

Package knitrprogressbar

Package labelvector. July 28, 2018

Package DSL. July 3, 2015

Package modules. July 22, 2017

Package available. November 17, 2017

Package kdtools. April 26, 2018

Package collapsibletree

Package tiler. June 9, 2018

Package lexrankr. December 13, 2017

Package getopt. February 16, 2018

Package geojsonsf. R topics documented: January 11, Type Package Title GeoJSON to Simple Feature Converter Version 1.3.

Package cli. November 5, 2017

Package gtrendsr. August 4, 2018

Package BiocManager. November 13, 2018

Package virustotal. May 1, 2017

Package datapasta. January 24, 2018

Package regexselect. R topics documented: September 22, Version Date Title Regular Expressions in 'shiny' Select Lists

Package vesselr. R topics documented: April 3, Type Package

Package gggenes. R topics documented: November 7, Title Draw Gene Arrow Maps in 'ggplot2' Version 0.3.2

Package rgdax. January 7, 2019

Package filematrix. R topics documented: February 27, Type Package

Package eply. April 6, 2018

Package censusapi. August 19, 2018

Package hyphenatr. August 29, 2016

Package pdfsearch. July 10, 2018

Package hashids. August 29, 2016

Package AdhereR. June 15, 2018

Package curry. September 28, 2016

Package calpassapi. August 25, 2018

Package JGR. September 24, 2017

Package crossword.r. January 19, 2018

Package assertive.code

Package CorporaCoCo. R topics documented: November 23, 2017

Package dotcall64. January 11, 2018

Package tibble. August 22, 2017

Package ompr. November 18, 2017

Package shinyhelper. June 21, 2018

Package goodpractice

Package tm.plugin.factiva

Package colf. October 9, 2017

Package processanimater

Package vip. June 15, 2018

Package tidyimpute. March 5, 2018

Package raker. October 10, 2017

Package rbraries. April 18, 2018

Package canvasxpress

Package sqliter. August 29, 2016

Transcription:

Type Package Package pbmcapply August 16, 2017 Title Tracking the Progress of Mc*pply with Progress Bar Version 1.2.4 Author Kevin Kuang (aut), Francesco Napolitano (ctb) Maintainer Kevin kuang <kvn.kuang@mail.utoronto.ca> Description A light-weight package helps you track and visualize the progress of parallel version of vectorized R functions (mc*apply). Parallelization (mc.core > 1) works only on *nix (Linux, Unix such as macos) system due to the lack of fork() functionality, which is essential for mc*apply, on Windows. Depends utils, parallel, future BugReports https://github.com/kvnkuang/pbmcapply/issues URL https://github.com/kvnkuang/pbmcapply License MIT + file LICENSE LazyData TRUE NeedsCompilation no Repository CRAN Date/Publication 2017-08-15 22:18:54 UTC R topics documented: pbmclapply......................................... 2 pbmcmapply........................................ 3 progressbar......................................... 4 Index 6 1

2 pbmclapply pbmclapply Tracking mclapply with progress bar Description Usage pbmclapply is a wrapper around the mclapply function. It adds a progress bar to mclapply function. Parallelization (mc.core > 1) works only on *nix (Linux, Unix such as macos) system due to the lack of fork() functionality, which is essential for mcapply, on Windows. pbmclapply(x, FUN,..., mc.style = "ETA", mc.substyle = NA, mc.cores =getoption("mc.cores", 2L), ignore.interactive = getoption("ignore.interactive", F)) Arguments X a vector (atomic or list) or an expressions vector. Other objects (including classed objects) will be coerced by 'as.list'. FUN the function to be applied to.... optional arguments to FUN. mc.cores see mclapply. mc.style, mc.substyle style of the progress bar. See progressbar. ignore.interactive whether the interactive() is ignored. If set to TRUE, the progress bar will be printed even in a non-interactive environment (e.g. called by Rscript). Can be set as an option "ignore.interactive". Examples # A lazy sqrt function which doesn't care about efficiency lazysqrt <- function(num) { return(sqrt(num)) # On Windows, set cores to be 1 if (.Platform$OS.type == "windows") { cores = 1 else { cores = 2

pbmcmapply 3 # A lazy and chatty sqrt function. # An example of passing arguments to pbmclapply. lazychattysqrt <- function(num, name) { return(sprintf("hello %s, the sqrt of %f is %f.", tostring(name), num, sqrt(num))) # Get the sqrt of 1-3 in parallel result <- pbmclapply(1:3, lazysqrt, mc.cores = cores) chattyresult <- pbmclapply(1:3, lazychattysqrt, "Bob", mc.cores = cores) pbmcmapply Tracking mcmapply with progress bar Description pbmcmapply is a wrapper around the mcmapply function. It adds a progress bar to mcmapply function. Parallelization (mc.core > 1) works only on *nix (Linux, Unix such as macos) system due to the lack of fork() functionality, which is essential for mcapply, on Windows. Usage pbmcmapply(fun,..., MoreArgs = NULL, mc.style = "ETA", mc.substyle = NA, mc.cores =getoption("mc.cores", 2L), ignore.interactive = getoption("ignore.interactive", F)) Arguments FUN the function to be applied in parallel to...... arguments to vectorize over (vectors or lists of strictly positive length, or all of zero length). MoreArgs mc.cores a list of other arguments to FUN. see mcmapply. mc.style, mc.substyle style of the progress bar. See progressbar. ignore.interactive whether the interactive() is ignored. If set to TRUE, the progress bar will be printed even in a non-interactive environment (e.g. called by Rscript). Can be set as an option "ignore.interactive".

4 progressbar Examples # A lazy sqrt function which doesn't care about efficiency lazysqrt <- function(num) { return(sqrt(num)) # On Windows, set cores to be 1 if (.Platform$OS.type == "windows") { cores = 1 else { cores = 2 # A lazy and chatty sqrt function. # An example of passing arguments to pbmcmapply. lazychattysqrt <- function(num, name) { return(sprintf("hello %s, the sqrt of %f is %f.", tostring(name), num, sqrt(num))) # Get the sqrt of 1-3 in parallel result <- pbmcmapply(lazysqrt, 1:3, mc.cores = cores) chattyresult <- pbmcmapply(lazychattysqrt, 1:3, MoreArgs = list("bob"), mc.cores = cores) progressbar Progress bar with the estimated time to completion (ETA). Description Usage This is an extended version of the txtprogressbar function with the estimated time to completion (ETA). Please refer to that for documentation (help(utils::txtprogressbar)). The original utils::settxtprogressbar can be used to update the bar. Use help(settxtprogressbar, "utils") to get help about the original function. progressbar(min = 0, max = 1, initial = 0, style = "ETA", substyle = NA, char = "=", width = NA, file = "") Arguments min, max, initial see txtprogressbar. style substyle style of the progress bar - see Details. substyle of the progress bar - only needed when style is set to certain value (see Details ).

progressbar 5 Details Value Note char, width, file see txtprogressbar. The progress bar should be closed when finished with: this outputs the final newline character. When style = "txt", it performs exactly the same as the original txtprogressbar. In this case, substyle shall be treated as the style in the original txtprogressbar. Please refer to the Detail of txtprogressbar for the meanings of substyles. When style = "ETA", it shows a progress bar with the estimated time to completion (ETA). Substyle is not used in this case. An object of class "txtprogressbar". Code derived from library pbareta (https://github.com/franapoli/pbareta) by Francesco Napolitano <franapoli@@gmail.com>. See Also txtprogressbar Examples # Test function testit <- function(x,...) { pb <- progressbar(...) for(i in c(0, x, 1)) { settxtprogressbar(pb, i) close(pb) # Txt progress bar testit(sort(runif(10)), style = "txt", substyle = 3) # ETA progress bar testit(sort(runif(10)), style = "ETA")

Index mclapply, 2 mcmapply, 3 pbmclapply, 2 pbmcmapply, 3 progressbar, 2, 3, 4 txtprogressbar, 4, 5 6