r fill a dataframe with parallel code -


i have written r function follows structure:

output <- data.frame(...) # declare appropriate dataframe      (files in folder)          (i in loop2)                (j in loop3)                     res <- ... # compute result                     name <- ... # compute name current row                     output <-  rbind(output,res)  # fill data frame...                     rownames(output)[nrow(output)]<-rowname # ... specific row name 

apparently, terrible in r. make treatment parallel, don't know how start. idea ? lot.

to inner loops need know more structure of data , doing make useful suggestions. end using lapply or sapply.

for outer loop foreach package may started. parallelization syntax looks loop, use rbind tool combine results.

in general, more efficient assign row names outside of inner loops in 1 step rather @ each inner step.


Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -