[R] help with parallel processing code

1Rnwb sbpurohit at gmail.com
Thu Oct 27 19:14:08 CEST 2011


my modification gives me error
>  rows<- c(1:nrow(mat))
>  scores <- c()
>  labels <-c()
>  itr<-1000
>  chnksz<-ceiling(itr/getDoParWorkers())
> smpopt=list(chunkSize=chnksz)
>  foreach(icount(itr),.combine=cbind,.options.smp=smpopts)%dopar%
+  {
+  train <- sample(rows, length(rows)-1)
+  label =0 ; if (mat$Self_T1D[-train] == "N") label = 1  #need the value
for this line, should it be 'N' or 'Y'
+  z <- lda(mat[train,4] ~ mat[train,1:3])
+  score = predict(z, mat[-train, ])$pos[1]
+  scores <- c(scores, score)
+  labels<- c(labels, label)
+  }
Error in { : task 1 failed - "could not find function "lda""

--
View this message in context: http://r.789695.n4.nabble.com/help-with-parallel-processing-code-tp3944303p3945243.html
Sent from the R help mailing list archive at Nabble.com.



More information about the R-help mailing list