[R] Following progress in a lapply() function

2009-03-22 Thread Blanchette, Marco
Dear all, I am processing a very long and complicated list using lapply through a custom function and I would like to generate some sort of progress report. For instance, print a dot on the screen every time 1000 item have been process. Or even better, reporting the percent of the list that hav

[R] IRanges::unlist in package

2013-08-07 Thread Blanchette, Marco
Dear all, I am writing a package with some of my favorite custom functions so that I can share them with others. I do not have a lot of experience building these packages and I apologize if this is a trivial question. The issue I am having is with the generic function unlist used to unlist GRa

[R] Transforming a list to a vector with associated levels

2008-11-18 Thread Blanchette, Marco
I am pretty sure that I came across a function that creates a vector of levels from a list but I just can't remember. Basically, I have something like > t <- list(A=c(4,1,4),B=c(3,7,9,2)) > t $A [1] 4 1 4 $B [1] 3 7 9 2 And I would like to get something like the following: t levels 4 1 1 1 4 1

[R] More list to vector puzzle

2008-11-19 Thread Blanchette, Marco
Many thanks for the answers on my previous question, it got me started. Indeed, stack() was the function I was vaguely remembering. However, I didnĀ¹t get very far because my data set is way more complicated then I expected. In fact I have a mixture of levels and lists within a list. Basically, it

[R] Dataframe with single level column

2008-11-21 Thread Blanchette, Marco
Dear all, I have a dataframe with multiple observations and the levels as the last column, as in: d <- data.frame(A=sample(1:100,12),B=sample(1:100,12),levels=c(rep('A',4),rep('B',4),rep('C',4))) > d A B levels 1 77 40 A 2 14 18 A 3 56 7 A 4 46 27 A 5 63 35 B

[R] Suppression anova message

2008-11-21 Thread Blanchette, Marco
Dear all, I am running anova(lm()) on a series of different data frame and I am getting the following message Using dataFrame$levels as id variables 1. Why am I getting that message 2. How do I suppress it (or correct it). Thanks Marco -- Marco Blanchette, Ph.D. Assistant Investigator S

[R] Suppression anova message

2008-11-21 Thread Blanchette, Marco
Dear all, I am running anova(lm()) on a series of different data frame and I am getting the following message Using dataFrame$levels as id variables 1. Why am I getting that message 2. How do I suppress it (or correct it). Thanks Marco -- Marco Blanchette, Ph.D. Assistant Investigator S

[R] 64bit R for Mac

2008-11-24 Thread Blanchette, Marco
Dear R gurus, On the CRAN website, it says that a 64bit version for Mac OS Tiger would be release shortly. Do we know what are the expected dates? Will the packages be also compiled for 64bit? We are running large microarray analysis and we keep hitting the 3Gb memory limit. I saw that there

Re: [R] editor for MacOS X

2008-11-28 Thread Blanchette, Marco
Carbon emacs ( http://homepage.mac.com/zenitani/emacs-e.html) using the ess-mode ( http://ess.r-project.org/). Amazingly good integration of different buffer types for different tasks. You can have your R session running in a buffer, a .R buffer where you edit your functions/sources and with ver

[R] Snow and multi-processing

2008-11-29 Thread Blanchette, Marco
Dear R gurus, I have a very embarrassingly parallelizable job that I am trying to speed up with snow on our local cluster. Basically, I am doing ~50,000 t.test for a series of micro-array experiments, one gene at a time. Thus, I can easily spread the load across multiple processors and nodes.

Re: [R] Snow and multi-processing

2008-11-30 Thread Blanchette, Marco
I think I found a solution. I do not like to use global variable by fear of unpredictable side-effects but, I think that in this case I don't have to much chance. Here is a mock function that pushes the content of a variable evaluated within a function to the nodes on the cluster, do some compu

Re: [R] command files

2008-12-02 Thread Blanchette, Marco
Try > source('myFirstScript.R') Where myFirstScript.R as the following line x <- rnorm(100) y <- rnorm(100) plot(x,y) You could also use a editor like emacs with the ess-mode where one buffer can be your script with a live R session in a second buffer. Good luck On 12/2/08 7:21 AM, "b g"

[R] Problem with the Rmpi package

2008-12-02 Thread Blanchette, Marco
Dear all, I just started to use the snow package to send multiple jobs on our cluster using MPI and the Rpmi package as the communication method. However, the Rmpi package have been behaving strangely. When I try to detach the Rmpi package I get the following error message: > library(Rmpi) > d