[R] help with parallel processing code

Dennis Murphy djmuser at gmail.com
Thu Oct 27 21:32:40 CEST 2011


Did you load the class package before calling lda()?

Dennis

On Thu, Oct 27, 2011 at 10:14 AM, 1Rnwb <sbpurohit at gmail.com> wrote:
> 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.
>
> ______________________________________________
> R-help at 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.
>



More information about the R-help mailing list