Provides Foreach Looping Construct

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. This package in particular is intended to be used for its return value, rather than for its side effects. In that sense, it is similar to the standard lapply function, but doesn't require the evaluation of a function. Using foreach without side effects also facilitates executing the loop in parallel.


News

NEWS/ChangeLog for foreach

1.4.4 2017-12-08 o Changed test report path for compliance with CRAN policies. o Removed startup message. o Changed seq(along=tags) call in makeAccum to seq(along.with=tags); request of Henrik Bengtsson. o Updated foreach help to describe effect of multiple arguments; request of David Winsemius.

1.4.3 2015-10-12 o Updated maintainer address

1.4.2 2014-04-10 o Unwound circular dependency chain with iterators package.

1.4.1 2013-05-29 o Improved handling of implicitly exported objects, courtesy of Steve Weston.

1.4.0 2012-04-11 o Removed spurious warning from getDoSEQ. Bug report from Ben Barnes. o Moved welcome message from .onLoad to .onAttach. Bug report from Benilton Carvalho. o Modified setDoPar and setDoSeq to undo changes to .foreachGlobals on error. Bug report from Benilton Carvalho. o Moved vignettes from inst/doc to vignettes. o Modified DESCRIPTION file by moving codetools, iterators, and utils from Depends to Imports. Bug report from Suraj Gupta.

1.3.5 2012-03-14 o Cleanup from previous patch. Bug report from Brian Ripley.

1.3.4 2012-03-12 o Added support for multiple sequential backends. (Idea and patch from Tyler Pirtle, Matt Furia, and Joseph Hellerstein.) o Modified doRUnit.R to use no more than two cores during R CMD check.

1.3.2 2011-05-08 o Regularized unit tests so they can run through R CMD check o Added support for compiler package of 2.13.0 and later.

1.3.1 2010-11-22 o First R-forge release.

Reference manual

It appears you don't have a PDF plugin for this browser. You can click here to download the reference manual.

install.packages("foreach")

1.4.7 by Hong Ooi, 5 months ago


Browse source code at https://github.com/cran/foreach


Authors: Hong Ooi [cre] , Microsoft [aut, cph] , Steve Weston [aut]


Documentation:   PDF Manual  


Task views: High-Performance and Parallel Computing with R


Apache License (== 2.0) license


Imports codetools, utils, iterators

Suggests randomForest

Enhances compiler, doMC, RUnit, doParallel


Imported by ADAPTS, ADMM, ADMMsigma, APIS, ApacheLogProcessor, Arothron, BDWreg, BMTME, BSGW, BSL, BTR, BVSNLP, BaTFLED3D, BayesBinMix, BootstrapQTL, BuyseTest, CARRoT, CBDA, CENFA, CFC, CNVScope, CVglasso, CalibratR, Causata, ClimDown, ClustVarLV, Compositional, ConR, Counterfactual, CovSelHigh, CovTools, DCD, DHARMa, DTDA.cif, DiffNet, Directional, E4tools, ECFsup, EFDR, EGAnet, EGRET, ENMeval, ESTER, EasyMARK, EcoGenetics, EmiStatR, EnsembleBase, EpiModel, FSelectorRcpp, FedData, FrechForest, GENLIB, GGIR, GLIDE, GMMAT, GPM, GWEX, GWLelast, GWRM, HDCI, HDtest, HEMDAG, HIMA, HMP, HMPTrees, HextractoR, HighDimOut, IDmining, IMAGE, Information, Infusion, InterpretMSSpectrum, JBTools, JMbayes, JOUSBoost, JointAI, KScorrect, LANDD, LCAvarsel, LEGIT, LUCIDus, LeArEst, MAGNAMWAR, MFPCA, ML.MSBD, MRFA, MSPRT, MXM, MachineShop, MarketMatching, Mediana, MlBayesOpt, Morpho, MultipleBubbles, NCA, NMF, NetRep, NetworkDistance, NetworkToolbox, OSTSC, OmicKriging, PARSE, PINSPlus, PLMIX, POUMM, PQLseq, PTE, PUlasso, ParBayesianOptimization, ParetoPosStable, PhyInformR, PhylogeneticEM, ProFound, ProcMod, QTL.gCIMapping, QTL.gCIMapping.GUI, QUALYPSO, R2MLwiN, RKEEL, RMTL, RMixtCompIO, RNOmni, RRphylo, RRreg, RSNPset, RStoolbox, RZooRoH, RcmdrPlugin.FuzzyClust, Rcrawler, ReIns, Rnmr1D, SAVER, SCOR, SCPME, SGP, SIDES, SLEMI, SemNeT, SimDesign, SparseMDC, Sstack, StAMPP, TED, TGS, TSMining, TSP, TestDesign, TriadSim, VICmodel, VSURF, WEE, WGCNA, WRTDStidal, WebGestaltR, YaleToolkit, ZIPFA, abcrf, adamethods, admixturegraph, aliases2entrez, amber, ashr, asremlPlus, assignPOP, astrochron, baggedcv, basket, bastah, bayou, bcRep, bdots, benchmarkme, bestNormalize, biclustermd, bigstatsr, bingat, binnednp, bisque, biwavelet, blackbox, blockmodeling, bnspatial, boostr, bossMaps, brainGraph, breakpoint, bst, calibrar, cape, caret, catlearn, ccfa, chemmodlab, chicane, clespr, clinDR, clogitLasso, clordr, clustDRM, clustcurv, clustvarsel, colocalized, conStruct, condSURV, contextual, cooccurNet, corr2D, creditmodel, cutpointr, dCovTS, dMod, dartR, dbfaker, ddsPLS, detrendr, dfConn, disaggregation, dissever, distantia, dtwclust, dynetNLAResistance, earlygating, ecospat, ei, enpls, equSA, ewoc, expose, exuber, ezCutoffs, ezsim, fDMA, fabMix, factorEx, factorcpt, fastLink, fastcmprsk, fastnet, fdANOVA, fda.usc, fdasrvf, fiberLD, fitPoly, forecastHybrid, fpmoutliers, funData, fuzzyforest, gamCopula, gambin, gamm4.test, gamreg, gapfill, gbts, gdalUtils, gdpc, gestate, glmaag, glmm, glmnet, groupedSurv, grpss, gscaLCA, gsynth, haploReconstruct, hbm, hdbinseg, hdnom, hettx, hindex, hybridModels, iRF, iZID, icenReg, iml, inctools, intamap, intccr, intercure, interflex, iprior, isocat, joineRML, kdevine, kernhaz, knnp, lass0, ldamatch, lfl, loggle, logiBin, lpirfs, lsbclust, mSTEM, marqLevAlg, mase, mazeinda, mbest, merTools, metaheur, metricTester, metsyn, mgwrsar, mimi, minimaxdesign, misclassGLM, missMDA, mistral, mixggm, mlbgameday, mma, moc.gapbk, momentuHMM, mpath, mplot, mrMLM, mrMLM.GUI, msaenet, mstherm, multiApply, multimark, multiviewtest, mvcwt, myTAI, npregfast, oak, odpc, opentraj, optiSel, otrimle, packMBPLSDA, paleoTS, parallelML, parallelSVM, pathfindR, pec, pencopulaCond, personalized, phenex, phenofit, phenopix, phylocurve, polymapR, polywog, portfolioBacktest, preprocomb, preprosim, primerTree, productivity, prospectr, proteomics, prozor, psgp, psymonitor, pterrace, qad, qrsvm, qualypsoss, rBayesianOptimization, rENA, rSHAPE, randomUniformForest, rangeMapper, rayshader, rcarbon, redist, regRSM, rem, resemble, reval, riskRegression, robustBLME, robustrao, rolypoly, rrepast, rrscale, rsppfp, rusda, santaR, scBio, scoper, scorecard, secsse, segMGarch, segmentr, semsfa, sen2r, sentometrics, shazam, sigminer, simPop, skpr, skyscapeR, smacof, smam, spacom, spant, sparr, spatial.tools, speaq, spectral.methods, sperich, sperrorest, spmoran, sptemExp, ss3sim, stR, stUPscales, staRdom, stablespec, survidm, synbreed, taxize, telefit, tempoR, text2vec, tigger, trackeR, trackeRapp, tsDyn, tsensembler, tsmp, tuts, ubiquity, ukbtools, unsystation, updog, varclust, vardpoor, viewshed3d, vqtl, windfarmGA, worldmet, xray, ykmeans, zebu.

Depended on by DNMF, DTRlearn2, Diderot, GA, GAparsimony, GaussianHMM1d, GiNA, HMMcopula, IDSpatialStats, LEANR, MAVTgsa, MEGENA, MetaPCA, MixRF, MonoInc, PAGWAS, PAWL, PortfolioAnalytics, QuantumClone, REPTILE, RGBM, Rlda, Rlof, RootsExtremaInflections, SDDE, SEA, SIMMS, SISIR, TPEA, VTrack, adabag, biganalytics, bigparallelr, cffdrs, conformalClassification, crso, cubfits, doFuture, doMC, doMPI, doParallel, doRNG, doRedis, doSNOW, eiCompare, evian, gam, gamsel, gdm, genlogis, gmDatabase, gofCopula, gpmap, hdlm, hzar, idmTPreg, integIRTy, kcpRS, localgauss, mSimCC, mbclusterwise, missForest, multicon, mutSignatures, penDvine, permGPU, perspectev, poolfstat, ramsvm, randomGLM, rlfsm, s4vd, sRDA, scRNAtools, sdcTarget, selfingTree, sglOptim, simMP, sms, survSNP, turboEM, unbalanced, weightQuant.

Suggested by AdaptGauss, BayesFactor, CPAT, CircSpaceTime, DEoptim, DiceKriging, FinancialInstrument, FixedPoint, GMCM, Interatrix, JWileymisc, MKmisc, NPflow, NetMix, R.SamBada, RBesT, Smisc, SpatialPosition, StepwiseTest, TcGSA, XGR, antaresRead, arrangements, batchtools, bayesboot, betapart, clustermq, combiter, data.tree, datafsm, datapackage.r, dcGOR, dnet, dplR, drtmle, epiGWAS, evolqg, eyetrackingR, fitTetra, fxregime, ggroups, greybox, hsdar, intkrige, iterators, iterpc, itertools, kergp, kselection, lava, lavaSearch2, msm, neuroim, pbo, plyr, pre, protr, ptycho, rDNAse, rioja, robustbase, rpg, sail, scanstatistics, simsalapar, spaMM, steps, strucchange, tableschema.r, treedater, valuer.


See at CRAN