foreach

R package to provide foreach looping construct

https://github.com/revolutionanalytics/foreach

Science Score: 13.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
  • DOI references
  • Academic publication links
  • Committers with academic emails
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (8.1%) to scientific vocabulary

Keywords

foreach parallel-computing r
Last synced: 6 months ago · JSON representation

Repository

R package to provide foreach looping construct

Basic Info
  • Host: GitHub
  • Owner: RevolutionAnalytics
  • License: apache-2.0
  • Language: R
  • Default Branch: master
  • Homepage:
  • Size: 210 KB
Statistics
  • Stars: 54
  • Watchers: 5
  • Forks: 4
  • Open Issues: 26
  • Releases: 0
Topics
foreach parallel-computing r
Created over 6 years ago · Last pushed about 2 years ago
Metadata Files
Readme License

README.md

foreach

CRAN Downloads R-CMD-check

This package provides support for the foreach looping construct. Foreach is an idiom that allows for iterating over elements in a collection, without the use of an explicit loop counter. The main reason for using this package is that it supports parallel execution, that is, it can execute repeated operations on multiple processors/cores on your computer, or on multiple nodes of a cluster. Many different adapters exist to use foreach with a variety of computational backends, including:

  • doParallel: execute foreach loops on clusters created with base R's parallel package
  • doFuture: using the future framework
  • doRedis: on a Redis database
  • doAzureParallel: on a compute cluster in Azure
  • and more.

Example

A basic for loop in R that fits a set of models:

r dat_list <- split(iris, iris$Species) mod_list <- vector("list", length(dat_list)) for(i in seq_along(dat_list)) { mod_list[[i]] <- lm(Sepal.Length ~ Sepal.Width + Petal.Length + Petal.Width, data=dat_list[[i]]) }

The same using foreach:

r library(foreach) mod_list2 <- foreach(dat=dat_list) %do% { lm(Sepal.Length ~ Sepal.Width + Petal.Length + Petal.Width, data=dat) }

The same, but fit in parallel on a background cluster. We change the %do% operator to %dopar% to indicate parallel processing.

```r library(doParallel) registerDoParallel(3) modlist2 <- foreach(dat=datlist) %dopar% { lm(Sepal.Length ~ Sepal.Width + Petal.Length + Petal.Width, data=dat) }

stopImplicitCluster() ```

Owner

  • Name: Revolution Analytics
  • Login: RevolutionAnalytics
  • Kind: organization
  • Location: Seattle | MtnView | Dallas | London | Singapore

GitHub Events

Total
  • Issues event: 1
  • Watch event: 4
  • Issue comment event: 3
Last Year
  • Issues event: 1
  • Watch event: 4
  • Issue comment event: 3

Committers

Last synced: 8 months ago

All Time
  • Total Commits: 82
  • Total Committers: 7
  • Avg Commits per committer: 11.714
  • Development Distribution Score (DDS): 0.549
Past Year
  • Commits: 0
  • Committers: 0
  • Avg Commits per committer: 0.0
  • Development Distribution Score (DDS): 0.0
Top Committers
Name Email Commits
Hong Ooi h****i@m****m 37
richcalaway r****y@c****t 32
weston s****n@g****m 5
Rich Calaway r****a@m****m 5
Folashade Daniel f****l@m****m 1
stefan7th s****h@e****b 1
Ubuntu h****o@f****t 1

Issues and Pull Requests

Last synced: 6 months ago

All Time
  • Total issues: 35
  • Total pull requests: 12
  • Average time to close issues: 3 months
  • Average time to close pull requests: 26 days
  • Total issue authors: 25
  • Total pull request authors: 5
  • Average comments per issue: 3.46
  • Average comments per pull request: 0.5
  • Merged pull requests: 4
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 1
  • Pull requests: 0
  • Average time to close issues: N/A
  • Average time to close pull requests: N/A
  • Issue authors: 1
  • Pull request authors: 0
  • Average comments per issue: 2.0
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • HenrikBengtsson (6)
  • pat-s (3)
  • latot (2)
  • privefl (2)
  • hongooi73 (2)
  • locklin (1)
  • mitokic (1)
  • descostesn (1)
  • beckermr (1)
  • PierreMasselot (1)
  • jmbuhr (1)
  • mikmart (1)
  • richcalaway (1)
  • ntthung (1)
  • vipulg13 (1)
Pull Request Authors
  • hongooi73 (5)
  • HenrikBengtsson (4)
  • sashahafner (2)
  • richcalaway (1)
  • mikmart (1)
Top Labels
Issue Labels
help wanted (1) enhancement (1)
Pull Request Labels

Packages

  • Total packages: 2
  • Total downloads:
    • cran 227,026 last-month
  • Total docker downloads: 35,455,984
  • Total dependent packages: 1,131
    (may contain duplicates)
  • Total dependent repositories: 3,017
    (may contain duplicates)
  • Total versions: 23
  • Total maintainers: 1
cran.r-project.org: foreach

Provides Foreach Looping Construct

  • Versions: 16
  • Dependent Packages: 1,055
  • Dependent Repositories: 2,964
  • Downloads: 227,026 Last month
  • Docker Downloads: 35,455,984
Rankings
Dependent packages count: 0.1%
Dependent repos count: 0.1%
Downloads: 0.7%
Average: 6.6%
Stargazers count: 7.1%
Forks count: 14.4%
Docker downloads count: 17.3%
Maintainers (1)
Last synced: 6 months ago
conda-forge.org: r-foreach
  • Versions: 7
  • Dependent Packages: 76
  • Dependent Repositories: 53
Rankings
Dependent packages count: 1.0%
Dependent repos count: 4.9%
Average: 26.7%
Stargazers count: 41.7%
Forks count: 59.2%
Last synced: 6 months ago

Dependencies

DESCRIPTION cran
  • R >= 2.5.0 depends
  • codetools * imports
  • iterators * imports
  • utils * imports
  • doMC * suggests
  • doParallel * suggests
  • knitr * suggests
  • randomForest * suggests
  • rmarkdown * suggests
  • testthat * suggests
.github/workflows/R-CMD-check.yaml actions
  • actions/cache v1 composite
  • actions/checkout v2 composite
  • actions/upload-artifact master composite
  • r-lib/actions/setup-pandoc master composite
  • r-lib/actions/setup-r master composite