Re: [R] assigning vector or matrix sparsely (for use with mclapply)

2012-03-27 Thread ilai
It is (at least for me) really unclear what the problem is, or how it's related to mclapply. You say this works fine, except that what I want to get NA's in the return positions that were not recalculated. then, I can write newdata$y - ifelse ( is.na(olddata$y), mc.byselectrows( olddata,

Re: [R] assigning vector or matrix sparsely (for use with mclapply)

2012-03-27 Thread ivo welch
I wasn't thinking straight. old.data= 11:20 recalc.please= (old.data%%2==0) old.data[recalc.please] [1] 12 14 16 18 20 new.data[recalc.please]= old.data[recalc.please]^2 Error in new.data[recalc.please] = old.data[recalc.please]^2 : object 'new.data' not found # this is where I had given

[R] assigning vector or matrix sparsely (for use with mclapply)

2012-03-26 Thread ivo welch
Dear R wizards--- I have a wrapper on mclapply() that makes it a little easier for me to do multiprocessing. (Posting this may make life easier for other googlers.) I pass a data frame, a vector that tells me what rows should be recomputed, and the function; and I get back a vector or matrix of