[R] Seeking help re: ? single apply command or an alternative

2011-04-21 Thread Min-Han Tan
Dear R-help list, Sorry to trouble everyone. This seems like it could be achieved with a single command (? variant of apply), but I am not quite seeing it. I am trying to multiply one vector (a1 below) by corresponding values in a3 (as determined by matching element in a vector a2). The example b

Re: [R] Deleting the last value of a vector

2011-04-17 Thread Min-Han Tan
Or perhaps even more parsimoniously (by a couple of characters) - r <- c(1, 2, 3, 4, 5) r2<-r[-length(r)] Min-Han On Sun, Apr 17, 2011 at 10:23 PM, Daisy Englert Duursma < daisy.duur...@gmail.com> wrote: > A easier solution: > > r <- c(1, 2, 3, 4, 5) > r2<-r[1:length(r)-1] > > > > > On Mon, Apr

[R] coxph and ordinal variables?

2010-09-08 Thread Min-Han Tan
Dear R-help members, Apologies - I am posting on behalf of a colleague, who is a little puzzled as STATA and R seem to be yielding different survival estimates for the same dataset when treating a variable as ordinal. Ordered() is used to represent an ordinal variable) I understand that R's coxph

Re: [R] Apologies : question on transforming a table

2010-05-06 Thread Min-Han Tan
6, 2010 at 3:38 PM, William Dunlap wrote: > > > Bill Dunlap > Spotfire, TIBCO Software > wdunlap tibco.com > > > -Original Message- > > From: r-help-boun...@r-project.org > > [mailto:r-help-boun...@r-project.org] On Behalf Of Min-Han Tan > > Sent:

[R] Apologies : question on transforming a table

2010-05-06 Thread Min-Han Tan
Dear R-help list, Apologies. I am trying to convert one table to another. It feels that it should be a very straightforward answer with a single (or two) commands with the right extensions, but I really can't figure this out right now. I have several hundred pheno factors actually, so manually do

[R] Problem with parsing a dataset - help earnestly sought

2010-04-22 Thread Min-Han Tan
Dear fellow R-help members, I hope to seek your advice on how to parse/manage a dataset with hundreds of columns. Two examples of these columns, 'cancer.problems', and 'neuro.problems' are depicted below. Essentially, I need to parse this into a useful dataset, and unfortunately, I am not familiar

Re: [R] tapply syntax

2010-03-26 Thread Min-Han Tan
Min-Han On Fri, Mar 26, 2010 at 12:40 PM, Min-Han Tan wrote: > Dear R-help members, > > Apologies for the trouble. > > I have a question : > > Essentially, I have a dataset which stores genetic variations for > individual patients. Each individual patient can have more t

[R] tapply syntax

2010-03-26 Thread Min-Han Tan
Dear R-help members, Apologies for the trouble. I have a question : Essentially, I have a dataset which stores genetic variations for individual patients. Each individual patient can have more than one variation, and each new record corresponds to a new variation (thus, both individual patients