Hi,
 
The code below does exactly what I want in sequential mode. But, it is slow and 
I want to run it in parallel mode. I examined some windows version packages 
(parallel, snow, snowfall,..) but could not solve my specific problem. As far 
as I understood, either I have to write a new function like sfRollapplyr or I 
have to change my code in a way that it utilizes lapply, or sapply instead of 
'rollapplyr' first then use sfInit, sfExport, and sfLapply,.. for parallel 
computing. I could not perform either so please help me :)
 
##
nc<-313
rs<-500000
ema<-10
h<-4
gomin1sd<-function (x,rho)
{
getOutliers(as.vector(x),rho=c(1,1))$limit[1]
}
dim(dt_l1_inp)
[1] 500000 312
dt_l1_min1<-matrix(nrow=rs, ncol=nc-1-(ema*h))
for (i in 1:rs) 
{
dt_l1_min1[i,]<-rollapplyr(dt_l1_inp[i,], FUN=gomin1sd, width=ema*h+1)
}
##   
        [[alternative HTML version deleted]]

______________________________________________
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to