[R] Help R - SNOW package...correct indexation syntax??

From: Ron Piccinini <ronpicci_at_yahoo.fr>
Date: Wed 28 Jul 2004 - 00:21:09 EST


Hello!

I am trying to apply estimators at various data lengths (data is resident on diferent nodes of a beowulf cluster) in order to save computation time.

On one side, suppose that:
x <- clusterCall(cl,runif,100000)
(i.e. 100,000 random numbers on each node) then the first say 100 numbers of node say #3 are returned by x.3.100 <- x[[3]][1:100]

On the other side, if one wanted to compute the average of each series individually, one could use: x.averages <- parSapply(cl,x,mean)

But what if one wanted to to compute the average of only the first 100 data points resident on each node? What would be the approriate syntax? Is the only (and fastest) solution to write a loop of the type:

for (j in numbernodes){x.avearges.100 <- mean(x[[j]][1:100]}

Or is there a more efficient par_apply method? I've been trying and trying to find a better way unfortunately to no avail.

Thanks in advance for your time and help,

Renaud Piccinini
University of Nebraska-Lincoln                                   

Vous manquez d’espace pour stocker vos mails ?



R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Wed Jul 28 00:31:50 2004

This archive was generated by hypermail 2.1.8 : Wed 03 Nov 2004 - 22:55:17 EST