[R] Do a log rank test of two group in a fit more with more than 2 groups

2009-12-17 Thread Anh Tran
Hi all, I'm trying to find a way to get a log-rank and Wilcoxon p-value of two single groups in a survfit() of coxph model (2 strata covariates). Is there a quick way to this information? survdiff() does not work with coxph model. -- Regards, Anh Tran [[alternative HTML version de

[R] problem with creating a netcdf file under script sh

2009-04-09 Thread Tu Anh Tran
Hi everyone, I try to make a netcdf file which disposes a difference between 2 variables of 2netcdf files same dimension When I programmed under R, everything is ok but when I put the code under EOF of a sh script, an error occurs: "Error, passed variable has a dim that is NOT of class dim.n

[R] Multiple R console for OS X?

2008-08-01 Thread Anh Tran
Hi gang, I always open more than 1 R console in Windows. I can't figure out a way to do this with OS X yet. I need that to utilize the duo core on my desktop. How would I do that? -- Regards, Anh Tran [[alternative HTML version de

[R] convert for loop into apply()

2008-08-01 Thread Anh Tran
[i]&a2$cat==a1$cat[i],]$id); } > a1$coverage [1] 1 1 2 2 0 1 This loop runs awefully slow when I have 200,000 probes and 30,000 fragments. Is there anyway I can speed this up with apply()? This is the time for my for loop to scan through the first 20 record of

Re: [R] Find max of a row in data frame (like Excel)

2008-06-25 Thread Anh Tran
gt; apply max to columns f1...f4 and assign it to rs$f: > > rs$f <- apply(rs[,paste("f",1:4,sep="")],1,max) > > or > > rs$f <- apply(rs[,2:5],1,max) > > > > On Wed, Jun 25, 2008 at 1:41 AM, Anh Tran <[EMAIL PROTECTED]> wrote: > >>

[R] Find max of a row in data frame (like Excel)

2008-06-24 Thread Anh Tran
6.624038 59 5 A_68_P20006729 16 44 0 0 0.85498261 6.044229 59 I want rs$f be the max of f1, f2, f3, f4 like a function in excel (=max(f1, f2, f3, f4)). How should we do it in R? I'm not familiar with programing with list. So please be patient Thanks -- Regards, Anh Tran [[alt

Re: [R] Scatter plot transparency

2008-06-21 Thread Anh Tran
Thanks, I think I've got it on Mac. Will try with my windows station tomorrow. Best, Anh Tran On Jun 21, 2008, at 12:05 AM, Prof Brian Ripley wrote: Please see the footer of this message. What do you want to be transparent, and what did you use to try to get it (there are

[R] Scatter plot transparency

2008-06-20 Thread Anh Tran
dots on a graph). So, is there a good way to import these plot in as picture so I can use them as layer for Illustrator (Photoshop would be fine too). Thank you all. -- Regards, Anh Tran [[alternative HTML version deleted]] __ R-help@r-p

Re: [R] Draw curve for histogram

2008-06-19 Thread Anh Tran
Thanks. I think I've got it. However, the density is plotted, not the frequency. Is there a way to convert the density back to frequency. Thanks a bunch. Anh Tran On Thu, Jun 19, 2008 at 3:33 PM, milton ruser <[EMAIL PROTECTED]> wrote: > Hi Anh, > > How about the reply b

[R] Draw curve for histogram

2008-06-19 Thread Anh Tran
s a way to illustrate, rather than bargraph. Thanks -- Regards, Anh Tran UCLA NeuroOncology Lab [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

[R] Opening more than 1 R console in Windows

2008-05-18 Thread Anh Tran
divide the work into two parts, and run them parallelly, they seems to utilize 100% of my CPU. So, my question would be that: is the computing result the same if I do them this way? Will there any mistake compared to running only one instance at a time? Thank you all. -- Regards, Anh Tran

Re: [R] Cleaning up memory in R

2008-05-14 Thread Anh Tran
Sorry, it's the stupid mistake on my part. Please forgive that question. I have to unload the variable first. On Wed, May 14, 2008 at 1:12 PM, Duncan Murdoch <[EMAIL PROTECTED]> wrote: > On 5/14/2008 3:59 PM, Anh Tran wrote: > >> I'm trying to work on a large datas

[R] Cleaning up memory in R

2008-05-14 Thread Anh Tran
ch -- Regards, Anh Tran [[alternative HTML version deleted]] __ 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 provide commented

Re: [R] Format integer

2008-05-12 Thread Anh Tran
Yea, thanks all. I checked back and I got a few things mistyped. The array is 650,000 and it took 25 seconds :p. It's acceptable. Just that I had too many variable at the time I ran it. Also, seems like sprintf is a little faster. Thanks all. Anh Tran On Mon, May 12, 2008 at 2:55 PM

Re: [R] Format integer

2008-05-12 Thread Anh Tran
Thanks. formatC(flag) works. But it's awefully slow. I try to do that for 65000 numbers (generating ID for each item) and it seems like forever. Is there any faster way? Thank all. Anh Tran On Mon, May 12, 2008 at 2:36 PM, Uwe Ligges < [EMAIL PROTECTED]> wrote: > > > Anh

[R] Format integer

2008-05-12 Thread Anh Tran
Hi, What's one way to convert an integer to a string with preceding 0's? such that '13' becomes '013' to be put into a string I've tried formatC, but they removes all the zeros and replace it with blanks Thanks -- Regards, Anh Tran

[R] Rescaling a column in a matrix based on a certain rows

2008-05-09 Thread Anh Tran
ow 1:5). column 1 and 2 are two different samples need to be compared. I hope I made myself clear enough. thanks for any help UCLA Neurology Research -- Regards, Anh Tran [[alternative HTML version deleted]] __ R-help@r-project.org mailing list

[R] Heat map on large sample size

2008-05-08 Thread Anh Tran
ow what to expect for 30,000... And on the side note, it seems like R only uses up to 50% of CPU while doing number crunching. Is there anyway to utilize 100% of CPU for R? I'm using R 2.6.2 on Windows XP SP2, average config. Thanks. UCLA Neurology Research Lab -- Regards, Anh Tran [[a

[R] loess model with different percentile

2008-05-06 Thread Anh Tran
taset. How about a local 99 percentile? Thanks.- -- Regards, Anh Tran [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-pro

[R] Print table data on to a plot

2008-05-06 Thread Anh Tran
Hi, Is there away to print a short table out along side with a plot? I'm thinking about doing a par(mfrow = c(1,2)) Then, the plot is on one side, summary result on the other. Is there any quick way to print out a data.frame in table format? Thanks -- Regards, Anh Tran [[altern

[R] Concatenate a vector into a string, only using distinct component

2008-05-06 Thread Anh Tran
I'm trying to use combine c('a','b','c','a','c') into 'a, b, c', the order does not matter. paste(c('a','b','c','a','c'), collapse=', ') yields 'a, b, c, a, c'.