[R] clusterCall with replicate function
I am trying to run a monte carlo process using snow with a MPI cluster. I have ~thirty processors to run the algorithm on and I want to run it 5000 times and take the average of the output. A very simple way to do this is to divide 5000 by the number of processors to get a number n and tell each processor to run the algorithm n times. I realize there are more efficient ways to manage the parallelization. To implement this I used the clusterCall command with the replicate function along the lines of clusterCall(cl, replicate, n, function(args)). Because my function is a monte carlo process it relies on drawing from random distributions to generate output. When I do this, all of my processors generate the same random numbers. I copied the following from the command space for a simple example: cl-makeCluster(cl, replicate,1,runif(2)) clusterCall(cl, replicate, 2, runif(2)) [[1]] 0.65339590.6533959 0.10710510.1071051 [[2]] 0.65339590.6533959 0.10710510.1071051 This is not alleviated by using clusterApply to set a random seed for each processor and seems to be related to the use of the replicate function within clusterCall. I have rearranged the function so that replicate is used to call the clusterCall function (ie. replicate(2, clusterCall(cl, runif,2),simplify=F) ) and resolved the random number issue. However, this also involves much more communication between master and slaves and results in slower computation time. Will rsprng fix this problem? Is there a better way to do this without using replicate? I hope this is somewhat clear. Thanks, Mike __ R-help@stat.math.ethz.ch 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.
[R] offset in coxph
The offset argument used in glm and other functions seems to have been removed from the argument list for coxph. I am wondering if there is a reason for this and if there is a possible work-around in order to produce a cox-ph object without fitting coefficients? Thanks, Mike __ R-help@stat.math.ethz.ch 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.
[R] justRMA
I am trying to preprocess a large dataset of affymetrix data. Creating an affybatch is not possible with the computer I am running it on, so I have used the justRMA command to run RMA. I have read the affy document describing the justRMA command and the help documentation but I am unclear as to whether this command uses median polish after normalization. I assume this is the case but would like to be sure before proceeding. Could someone clear up this confusion? Thanks, Mike [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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.
[R] Access Rows in a Data Frame by Row Name
I have created a data frame using the read.table command. I want to be able to access the rows by the row name, or a vector of row names. I know that you can access columns by using the data.frame.name$col.name. Is there a way to access row names in a similar manner? [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch 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.