[R] How to fine control bar plot width?

2014-11-01 Thread Fabrice Tourre
Dear expert, I want to combine 4 figures in the same plot. Each bar plot is related to the image() plot. I want to bar width is extractly the same width as grid width in the image() plot. The up-barplot and the left-barplot. I have pasted my code to follow. How can I modify for this purpose?

[R] How can make loop more faster?

2013-06-15 Thread Fabrice Tourre
Dear expert, How can I make follow codematrix function more faster? top20.dat - top20.dat[,7:length(top20.dat[1,])] top40.dat - read.table(top40snps.ped,header=F,sep=\t,stringsAsFactors=F) row.names(top40.dat) - top40.dat[,1] top40.dat - top40.dat[,7:length(top40.dat[1,])] codematrix -

[R] Add text A, B, C and D on multiple ordered plot

2013-02-08 Thread Fabrice Tourre
Dear list, Is there a elegant way to name multiple ordered plot as A, B, C and D? Just put A, B, C and D on the top left corner of each plot. Usually I do it in Illustrator, but I think in R should there is a way. Could you please provide a example? Thank you very much in advance.

Re: [R] Add text A, B, C and D on multiple ordered plot

2013-02-08 Thread Fabrice Tourre
Thank your reminder. Here is the example code: a- rnorm(1000,0,1) b-rnorm(1000,0,2) c-rnorm(1000,0,3) d-rnorm(1000,0,4) par(mfrow=c(2,2)) hist(a) hist(b) hist(c) hist(d) I want to add A, B, C and D on each top left. On Fri, Feb 8, 2013 at 2:35 PM, John Kane jrkrid...@inbox.com wrote: Yes there

Re: [R] Add text A, B, C and D on multiple ordered plot

2013-02-08 Thread Fabrice Tourre
John Kane, Thanks. It makes some of sense. But it seems not exactly what I want. I just remember it need using mtext and adjust margin. I saw such of example long time ago, but I have forgotten it. On Fri, Feb 8, 2013 at 3:32 PM, John Kane jrkrid...@inbox.com wrote: Here is a rough example of

[R] Package: VennDiagram. Error in draw.pairwise.venn Impossible: cross section area too large

2013-01-27 Thread Fabrice Tourre
Dear list, When I use VennDiagram package, I got a error as follow: venn.plot - draw.pairwise.venn( area1 = 3186, area2 = 325, cross.area = 5880); Error in draw.pairwise.venn(area1 = 3186, area2 = 325, cross.area = 588) : Impossible: cross section area too large. Does anyone have

Re: [R] Package: VennDiagram. Error in draw.pairwise.venn Impossible: cross section area too large

2013-01-27 Thread Fabrice Tourre
) or set 2 (area2 parameter). You probably want: venn.plot - draw.pairwise.venn( area1 = 3186 + 5880, area2 = 325 + 5880, cross.area = 5880); Paul -Original Message- From: hiek...@gmail.com [mailto:hiek...@gmail.com] On Behalf Of Fabrice Tourre Sent: January-27-13 5:06 PM To: r

Re: [R] Basic question about: - and method start with dot.

2012-10-02 Thread Fabrice Tourre
require(fortunes) Loading required package: fortunes fortune(-) I wish - had never been invented, as it makes an esoteric and dangerous feature of the language *seem* normal and reasonable. If you want to dumb down R/S into a macro language, this is the operator for you. -- Bill Venables

[R] Basic question about: - and method start with dot.

2012-10-01 Thread Fabrice Tourre
Dear list, When I read some source code, I find lot of place used symbol - , e.g. lastTime - newTime; What is the meaning here? Also, I find some method with the name start with dot, e.g. .RowStandardizeCentered = function(x) { div = sqrt( rowSums(x^2) ); div[ div == 0 ] = 1;

[R] multicore, mclapply memory problem

2012-06-29 Thread Fabrice Tourre
Dear list, I am using mclapply(from multicore) to use multiple cores on one server. If I do not use mclapply, just one core, my R problem will use 4G memory. When I use mclapply and set mc.cores =10, each core will use 4G memory. So totally it will use 40G memory. Is it possible let each core to

Re: [R] multicore, mclapply memory problem

2012-06-29 Thread Fabrice Tourre
Thank you for your reply. I used debian system. I will try parallel. Thanks. uname -a Linux m1000e1-m610-6 2.6.26-2-amd64 #1 SMP Tue Mar 9 22:29:32 UTC 2010 x86_64 GNU/Linux sessionInfo() R version 2.14.2 (2012-02-29) Platform: x86_64-unknown-linux-gnu (64-bit) locale: [1] C attached base

Re: [R] Multi-threads in R

2012-06-17 Thread Fabrice Tourre
I think multicore is one of answer if you can write your function in to lapply. On Mon, Jun 18, 2012 at 12:14 PM, R. Michael Weylandt michael.weyla...@gmail.com wrote: I would argue (somewhat emphatically) that the parallel facilities you are looking at are absolutely not for `for` loops. `for`

Re: [R] wgcna

2012-06-16 Thread Fabrice Tourre
Peter, Thank you. In fact, I am also very interesting to WGCNA. On Sat, Jun 16, 2012 at 3:29 AM, Peter Langfelder peter.langfel...@gmail.com wrote: On Fri, Jun 15, 2012 at 8:04 AM, Ingezz irholt...@gmail.com wrote: Dear Peter, I am trying to apply the WGCNA meta-analysis for two (or more)

Re: [R] gsub/strsplit with multiple patterns/splits

2012-05-31 Thread Fabrice Tourre
0 and 1 means zero or 1 match. Want to remove the word Energy? gsub(( Energy){0,1},{0,1} Inc[.]{0,1}, , DF) On Thu, May 31, 2012 at 11:45 AM, mdvaan mathijsdev...@gmail.com wrote: Thanks! That works like a charm, but I am not sure if I fully understand the syntax. I looked at the gsub page

[R] Simple example for High performance computing with R?

2012-05-29 Thread Fabrice Tourre
Dear list, I want to run two independent calculation (A, B) and then combined their results to do a plot in R. Before I just run calculation A first, then calculation B. It will take some times. I just have one server with multiple core. I noticed that there are some nice package in R for

[R] How can I check a package is installed or not?

2011-09-27 Thread Fabrice Tourre
Dear list, How can I detect a package is installed or not? If not, then install it. For example, in a script, I want to check the package DESeq is installed or not. If not, then I will using this script to install it. source(http://www.bioconductor.org/biocLite.R;) biocLite(DESeq) The pseudo

Re: [R] How can I check a package is installed or not?

2011-09-27 Thread Fabrice Tourre
Thank you for your sharing I got it. On Tue, Sep 27, 2011 at 9:44 PM, David Winsemius dwinsem...@comcast.net wrote: On Sep 27, 2011, at 3:19 PM, Fabrice Tourre wrote: Dear list, How can I detect a package is installed or not? If not, then install it. For example, in a script, I want

[R] Calculated mean value based on another column bin from dataframe.

2011-04-06 Thread Fabrice Tourre
Dear list, I have a dataframe with two column as fellow. head(dat) V1 V2 0.15624 0.94567 0.26039 0.66442 0.16629 0.97822 0.23474 0.72079 0.11037 0.83760 0.14969 0.91312 I want to get the column V2 mean value based on the bin of column of V1. I write the code as fellow. It

Re: [R] Calculated mean value based on another column bin from dataframe.

2011-04-06 Thread Fabrice Tourre
...@gmail.com wrote: Try this: fil - sapply(ran, '', e1 = dat[,1]) sapply(ran[2:(length(ran) + 1)], '=', e1 = dat[,1]) mm - apply(fil, 2, function(idx)mean(dat[idx, 2])) On Wed, Apr 6, 2011 at 5:48 AM, Fabrice Tourre fabrice.c...@gmail.com wrote: Dear list, I have a dataframe with two column

Re: [R] Odp: Calculated mean value based on another column bin from dataframe.

2011-04-06 Thread Fabrice Tourre
This is extractly what I want. Thank you very much. On Wed, Apr 6, 2011 at 5:22 PM, Petr PIKAL petr.pi...@precheza.cz wrote: Hi r-help-boun...@r-project.org napsal dne 06.04.2011 10:48:04: Dear list, I have a dataframe with two column as fellow. head(dat)        V1      V2  0.15624

Re: [R] Calculated mean value based on another column bin from dataframe.

2011-04-06 Thread Fabrice Tourre
Thanks. Before I never used findInterval function. It seems very nice. On Wed, Apr 6, 2011 at 11:20 PM, David Winsemius dwinsem...@comcast.net wrote: On Apr 6, 2011, at 9:46 AM, Fabrice Tourre wrote: Dear Henrique Dallazuanna, Thank you very much for your suggestion. It is obvious

Re: [R] Calculate probabilty

2011-02-25 Thread Fabrice Tourre
Hi Rex, Thanks for you explain. In fact, my question is: When I observed that there are 6 or more balls in one box, what is this probability? The ball is randomly put into the boxes. I think it is: 1-pbinom(6,142,1/491) = 2.272026e-08. When the sample size is large, how should I do this? using

[R] Calculate probabilty

2011-02-24 Thread Fabrice Tourre
Hi List, I have a question to calculate probability using R. There are 491 boxes and 142 balles. If the ball randomly put into the box. How to calculate the probability of six or more there are in one box? I have try : dbinom(6,142,1/491) 1-pbinom(6,142,1/491) But I think I have some unclear

[R] Help for lattice. par(new=TRUE)

2011-01-21 Thread Fabrice Tourre
Hi list, I want to plot two plot in the same figure. I set par(new=TRUE). But it does not work. library(lattice) myPanel - function(x,...) { panel.histogram(x,alpha=0.4,...) ltext(0.4,1.5,paste(Mean=,0.05,digit=2)),cex=0.8) ltext(0.8,1.5,paste(s.d.=,0.06,digit=2)),cex=0.8) }

Re: [R] How to find more about Covariance (in R)

2011-01-19 Thread Fabrice Tourre
population is all individual. sample is a part of population. If the sample size is enough large, mean(sr*sr)-mean(sr)*mean(sr) will almost equal to cov(sr, sr). On Wed, Jan 19, 2011 at 3:59 PM, Alaios ala...@yahoo.com wrote: Dear Josh, I would like to thank you for your reply. I think that

Re: [R] Help for R plot

2011-01-18 Thread Fabrice Tourre
Hi Thanks for you suggestion. I used histograme in lattice packages. If it is possible lattice can do it, it will be better. On Mon, Jan 17, 2011 at 3:28 PM, Peter Ehlers ehl...@ucalgary.ca wrote: On 2011-01-17 02:26, Fabrice Tourre wrote: Hi all, How to plot as the coordinate  as in my

[R] Help for R plot

2011-01-17 Thread Fabrice Tourre
Hi all, How to plot as the coordinate as in my attachment? I want to trim the coordinate and one of plot as the figure in attachment. Does any one have such example? Thanks. attachment: Screen shot 2011-01-17 at 11.22.20 AM.png__ R-help@r-project.org

[R] How to covernt this list to data.frame?

2010-12-16 Thread Fabrice Tourre
using dget to try this data. dget(probesnum)-a some data length is 3, some is 4. thanks. __ R-help@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