Displaying 20 results from an estimated 20000 matches similar to: "Using Foreach for downloading data"
2016 Apr 27
0
using foreach function with gtrendsR
I have this code which is working
library("checkpoint")
library("gtrendsR")
library("doParallel")
cl<-makeCluster(4)
registerDoParallel(cl)
gconnect(usr = "email at gmail.com", psw = "password", verbose = FALSE)
names <- c("apple","shit", "android", "rocks")
formula <- function(x){
x0 <-
2011 Jul 12
2
foreach not recognizing functions in memory
All,
I am not understanding the scoping used in foreach when it is used
inside a function. I keep getting "could not find function" errors for
functions that are in memory when I try to use foreach within a function
call. I have a simple example below. "testFun" is in memory and works
when called by foreach directly, but when I place foreach in a function
called
2011 Apr 19
0
doSMP package works better than perfect, at least sometimes.
Some might have noticed that REvolution Computing released the doSMP
package to the general public about a month and a half ago, which allows
multiple cores to be accessed for parallel computation in R. Some of our
physical habitat calculations were taking an extraordinary amount of time
to complete and required over-weekend runs, which prompted our interest in
this package. What follows
2012 Oct 25
1
parallel processing with foreach
Hi,
I am trying to parallel computing with foreach function, but not able to
get the result. I know that in parallel processing, all result is collected
in list format, but I am not able to get input there.
Any help is really appreciated.
esf.m <-foreach (i = 1:n.s, .combine=rbind) %dopar% {
EV <- as.data.frame(eig$vectors[,1:n.candid[i]])
colnames(EV) <- paste("EV",
2018 Mar 12
0
Package gamlss used inside foreach() and %dopar% fails to find an object
Hello Mikis:
Thanks a lot, it worked. Could you tell me what the problem was?
Regards,
Nik
----- Original Message -----
From: r-help-request at r-project.org
To: "r-help"
Sent: Sunday, March 11, 2018 6:00:02 AM
Subject: R-help Digest, Vol 181, Issue 11
Send R-help mailing list submissions to
r-help at r-project.org
To subscribe or unsubscribe via the World Wide Web, visit
2011 Jan 14
0
Fwd: Re: [R-sig-hpc] Working doSNOW foreach openMPI example
Whas missing the R in the command line:
"mpirun -n --hostfile /home/hostfile R --no-save -f rtest.R"
Hope this helps
mario
On 13-Jan-11 22:08, Justin Moriarty wrote:
> Hi,
> Just wanted to share a working example of doSNOW and foreach for an openMPI cluster. The function eddcmp() is just an example and returns some inocuous warnings. The
2015 May 11
1
Foreach %dopar% operator incorrectly load balancing
Dear R-SIG-Debian,
I am using R version 3.1.2 with rstudio-server 0.98.113 on debian build
3.2.0-4-amd64 #1 SMP Debian 3.2.68-1+deb7u1 x86_64 GNU/Linux.
I often use the %dopar% operator in from the foreach package to run code in
parallel. However, the only other use on the box seemingly installed a few
items and suddenly %dopar% will use far more than the number of cores I am
specifying and
2018 Mar 09
0
Package gamlss used inside foreach() and %dopar% fails to find an object
If the code you are running in parallel is complicated, maybe foreach is not sophisticated enough to find all the variables you refer to. Maybe use parallel::clusterExport yourself? But be a aware that passing parameters is much safer than directly accessing globals in parallel processing, so this might just be your warning to not do that anyway.
--
Sent from my phone. Please excuse my brevity.
2018 Mar 10
0
. Package gamlss used inside foreach() and %dopar% fails to find an object (Nik Tuzov)
Dear Nik
Try the following code
loo_predict.mu <- function(model.obj, input.data) {
yhat <- foreach(i = 1 : nrow(input.data), .packages="gamlss", .combine = rbind) %dopar% {
updated.model.obj <- update(model.obj, data = input.data[-i, ])
predict(updated.model.obj, what = "mu", data = input.data[-i, ],
newdata = input.data[i,], type =
2010 Nov 11
0
logging interim results using foreach/doMC
Dear all,
I am converting a large process to a parallel backhend using doMC and
foreach. Basically, I havea long list of input graph files and each of
them calls soem basic igraph package functions. I am parallelizing the
run, in order to save time. All works fine, and each %dopar% call ends
with a vector of results that at the end got fed into a data frame and
saved as a csv table.
When I
2012 Jun 15
0
argument "x" is missing, with no default - Please help find argument x
R programming question, not machine learning, although that's the content.
Apologies to all for whom the following code is eye-burning. I am using
foreach() to run a simulation on a randomForest model (actually conditional
randomForest ... "party" package). The simulation is in two dimensions.
examining how "mtry" and "ntrees" are related in terms of predictive
2012 Aug 08
1
random number generator with SNOW/ Parallel/ foreach
Dear All,
I have three classes of questions about generating random numbers with
different packages (windows xp 32bit R).
.
1. Suppose I would like to use package *foreach*, can I use current
Sys.time as a seed?
Although I can get the time up to1e-6 second precesion, the code below dose
not work well on a local machine with two cores. #################
library(foreach)
library(snow)
2018 Mar 09
2
Package gamlss used inside foreach() and %dopar% fails to find an object
Hello all:
Please help me with this "can't find object" issue. I'm trying to get leave-one-out predicted values for Beta-binomial regression.
It may be the gamlss issue because the code seems to work when %do% is used. I have searched for similar issues, but haven't managed to figure it out. This is on Windows 10 platform.
Thanks in advance,
Nik
#
2012 Jan 19
1
converting a for loop into a foreach loop
Dear all,
Just wondering if someone could help me out converting my code from a for()
loop into a foreach() loop or using one of the apply() function. I have a
very large dataset and so I'm hoping to make use of a parallel backend to
speed up the processing time. I'm having trouble getting selecting three
variables in the dataset to use in the foreach() loops. My for() loop code
is:
2013 Apr 24
0
help with execution of 'embarrassingly parallel' problem using foreach, doParallel on a windows system
Dear R helpers,
I have what another member on this forum described as
an embarrassingly parallel problem. I am trying to fit models on subsets of
some data based on unique combinations of two id factors in the dataset.
Total number of combinations is 30^5, and this takes a long time. So, I
would like fit models for each of the datasets produced by subsetting on
the unique combinations, splitting
2011 May 27
0
saving multiple arrays from a foreach loop
Dear R-List member,
I have a problem when I'm trying to save two arrays from a foreach-loop.
I'm also not sure whether this is possible or just my inexperience.
However, this works perferctly fine with a for-loop.
Here is an example code - any help is much appreciated!!:
############
n.vpn = 2
n.run= 3
# create to empty matrices
sme = matrix(NA,4,n.vpn)
test = matrix(NA,4,n.vpn)
#
2012 May 08
1
revolution foreach oddity
I know this is not a revolution support forum, but as anyone noticed the
following?
I have a foreach loop to generate random samples. If I run the exact code
below in normal r (2.14.1) it works as expected, but if I run it from
revolution 4.2.0 each loop returns the same numbers.
The only way I can get revolution to give different numbers is using 1
instead of 8 in
registerDoSNOW(makeCluster(8,
2012 Sep 21
2
Parallel Programming
I am trying to do parallel programming and I tried this
library(doSNOW)
library(foreach)
testfunc<-function(x){
x<-x+1
x
}
noc<-2
cl <- makeCluster(do.call(rbind,rep(list("localhost"),noc)), type = "SOCK")
registerDoSNOW(cl)
clusterExport(cl=cl,c("testfunc.r"))
testl<-foreach(pp=1:2) %dopar% {
testfunc(pp)
}
And this works but if I try to
2011 Feb 25
1
Question about foreach (with doSNOW), is that a bug?
Hi all,
Within a foreach loop with doSNOW, we cant call functions which come from
the non-default package. We need to load(require/library) the package once
more within the foreach loop. Anyone knows why would happen like this? Is it
caused by the snow package and something happened when "snow" parallelize
the job?
Other than load the package once more with in the foreach loop, is
2011 May 27
0
object not found with %dopar% when using foreach
Dear R-List member,
tried implement the foreach loop. It works fine, when I'm using %do%,
but not when I'm using %dopar%.
I always receive one of the following error messages:
error in { : task 1 failed - "Objekt 'S3' not found" - could the
.export be an solution for this??
Any help is much appreciated!
The Code hast the following structure:
##########
dft3 =