foreach
R package to provide foreach looping construct
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
Repository
R package to provide foreach looping construct
Basic Info
Statistics
- Stars: 54
- Watchers: 5
- Forks: 4
- Open Issues: 26
- Releases: 0
Topics
Metadata Files
README.md
foreach
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
- Website: http://www.revolutionanalytics.com
- Repositories: 26
- Profile: https://github.com/RevolutionAnalytics
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
Top Committers
| Name | 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 |
Committer Domains (Top 20 + Academic)
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
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
- Homepage: https://github.com/RevolutionAnalytics/foreach
- Documentation: http://cran.r-project.org/web/packages/foreach/foreach.pdf
- License: Apache License (== 2.0)
-
Latest release: 1.5.2
published about 4 years ago
Rankings
Maintainers (1)
conda-forge.org: r-foreach
- Homepage: https://github.com/RevolutionAnalytics/foreach
- License: Apache-2.0
-
Latest release: 1.5.2
published about 4 years ago
Rankings
Dependencies
- R >= 2.5.0 depends
- codetools * imports
- iterators * imports
- utils * imports
- doMC * suggests
- doParallel * suggests
- knitr * suggests
- randomForest * suggests
- rmarkdown * suggests
- testthat * suggests
- 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