Re: [R] Help with correlation matrices, thresholding

2012-07-18 Thread Drinniol
Thank you! I had to make some modifications since my data is between a data set and a subset not one data set to itself, but I was able to use essentially your method to get it working. I did have some trouble with the matrix command on the last line - it kept returning lots of NAs. So I just

Re: [R] Help with correlation matrices, thresholding

2012-07-16 Thread Bert Gunter
I suggest you post this on the Bioconductor list instead, as it would seem much more relevant to your concerns. -- Bert On Mon, Jul 16, 2012 at 1:55 PM, Drinniol wrote: > Hello, I am new to R and have a problem I have had some trouble with. > > Basically I have a list of some 8 genes or so

Re: [R] Help with correlation matrices, thresholding

2012-07-16 Thread chuck.01
Try this as a starting point; dat is your whole data set, and r = correlation coefficient threshold: spec.cor <- function (dat, r, ...) { x <- cor(dat, ...) x[upper.tri(x, TRUE)] <- NA i <- which(abs(x) >= r, arr.ind = TRUE) data.frame(matrix(colnames(x)[as.vector(i)], ncol = 2)

[R] Help with correlation matrices, thresholding

2012-07-16 Thread Drinniol
Hello, I am new to R and have a problem I have had some trouble with. Basically I have a list of some 8 genes or so with data points for expression levels at various time points/conditions. I also have subsets of these, usually only a few hundred genes in size, known to be associated with s