[R] reshaping data

2009-10-21 Thread Lo, Ken
Hi all, I have a matrix of correlation values between all pairwise comparison in an experiment. For example, I have 2 time points (1,2) each in triplicate. Thus, I have the following matrix 1-1 1-2 1-3 2-1 2-2 2-3 1-1 NA ... ... ... ... ... 1-2 ... NA ... ... ... ...

[R] FW: reshaping data

2009-10-21 Thread Lo, Ken
I apologize for the previous post using HTML. Haven't posted for a while and e-mail client default. Best, Ken Hi all, I have a matrix of correlation values between all pairwise comparison in an experiment.  For example, I have 2 time points (1,2) each in triplicate. Thus, I have the

[R] FW: flow control

2009-03-04 Thread Lo, Ken
Hi all, I need a little help with flow control in R. What I'd like to do is to advance a for loop by changing its counter. However, what seems obvious to me does not yield the proper results. An example of my problem is for (i in seq(1, some_number, some_increment)){ some stuff

[R] coercing a list into matrix

2009-01-14 Thread Lo, Ken
Dear list, I have a list of number sequences. Each number sequence has different numbers of elements. Is there a quick way (other than to iterate through the entire list) way to coerce list to matrix with NAs filling in the short sequences? An example of what I mean is this: A -

[R] how to iterate through a list using ls

2008-11-01 Thread Lo, Ken
Hi all, I know this is an idiotic question, but I am trying to iterate through a list of data.frame using ls (I have named the data frames in a way that lets me subset them with ls(pattern=test, for example). But ls returns a character vector. How to I refer to the data frames by their names in

[R] Question about quantile.default

2008-10-03 Thread Lo, Ken
Hi all, I am running into a snag using quantile function in stats. Basically, I don't understand why the loop below throws the error that it does. test.data - rnorm(1000, 0, 1) for (i in seq(0.1, 0.001, 0.1)){ test - quantile(test.data, probs=seq(0,1,i)); print(i); }

[R] Question about quantile.default

2008-10-03 Thread Lo, Ken
Hi all, I am running into a snag using quantile function in stats. Basically, I don't understand why the loop below throws the error that it does. test.data - rnorm(1000, 0, 1) for (i in seq(0.1, 0.001, 0.1)){ test - quantile(test.data, probs=seq(0,1,i)); print(i); }

[R] operators %/% bug?

2008-03-31 Thread Lo, Ken
Dear all, I have come across a strange behavior of the %/% operator, and I wasn't sure if this was intended. i.e. a - 1.2 b - 1.0 (a-b) %/% 0.1 results in 1? Whereas 0.2 %/% 0.1 results in 2. Am I missing something obvious here? It seems to be consistent up to R 2.6.0 running

[R] help with mclust

2007-10-03 Thread Lo, Ken
2051,0.00582,-0.019189,-0.009029,0.001875,0.015273,0.175303,-0.092441,-0 .086738,-0.022871,0.027852,-0.108809,0.005938,-0.016543,-0.019288,0.2105 66,-0.022813,-0.001748,-0.108574,0.164971,-0.075186) If anyone could help me out, I would be extremely grateful. Best, Ken Lo

[R] FW: help with mclust

2007-10-03 Thread Lo, Ken
,-0.218613,0.024902,0.020273,0.011914,0.162051,0.00582,-0.019189,-0.009029,0.001875,0.015273,0.175303,-0.092441,-0.086738,-0.022871,0.027852,-0.108809,0.005938,-0.016543,-0.019288,0.210566,-0.022813,-0.001748,-0.108574,0.164971,-0.075186) If anyone could help me out, I would be extremely grateful. Best, Ken Lo