Re: [R] in cor.test, difference between exact=FALSE and exact=NULL

2007-09-01 Thread Andrew Yee
Thanks for the clarification. I should have recognized the difference between warning and error. But if I may take this a step further, shouldn't it then be exact=TRUE instead of exact=NULL? Thanks, Andrew On 8/31/07, Peter Dalgaard [EMAIL PROTECTED] wrote: Andrew Yee wrote: Pardon my

[R] in cor.test, difference between exact=FALSE and exact=NULL

2007-08-23 Thread Andrew Yee
Pardon my ignorance, but is there a difference in cor.test between exact=FALSE and exact=NULL when method=spearman? Take for example: x-c(1,2,2,3,4,5) y-c(1,2,2,10,11,12) cor.test(x,y, method=spearman, exact=NULL) This gives an error message, Warning message: Cannot compute exact p-values with

[R] multiple colors within same line of text

2007-08-16 Thread Andrew Yee
Hi, I'm interested in using mtext(), but with the option of having multiple colors in the same line of text. For example, creating a line of text where: Red is red and blue is blue How do you create a text argument that lets you do this within mtext()? Thanks, Andrew MGH Cancer Center

[R] why doesn't as.character of this factor create a vector of characters?

2007-07-10 Thread Andrew Yee
I'm trying to figure out why when I use as.character() on one row of a data.frame, I get factor numbers instead of a character vector. Any suggestions? See the following code: a-c(Abraham,Jonah,Moses) b-c(Sarah,Hannah,Mary) c-c(Billy,Joe,Bob) df-data.frame(a=a,b=b,c=c) #Suppose I'm interested

[R] using the function unique(), but asking it to ignore a column of a data.frame

2007-07-09 Thread Andrew Yee
Take for example the following data.frame: a-c(1,1,5) b-c(3,2,3) c-c(5,1,5) sample.data.frame-data.frame(a=a,b=b,c=c) I'd like to be able to use unique(sample.data.frame), but have unique() ignore column a when determining the unique elements. However, I figured that this would be setting for

Re: [R] using the function unique(), but asking it to ignore a column of a data.frame

2007-07-09 Thread Andrew Yee
Thanks. But in this specific case, I would like the output to include all three columns, including the ignored column (in this case, I'd like it to ignore column a). Thanks, Andrew On 7/9/07, hadley wickham [EMAIL PROTECTED] wrote: On 7/9/07, Andrew Yee [EMAIL PROTECTED] wrote: Take

Re: [R] using the function unique(), but asking it to ignore a column of a data.frame

2007-07-09 Thread Andrew Yee
Thanks, this works perfectly. On 7/9/07, Prof Brian Ripley [EMAIL PROTECTED] wrote: On Mon, 9 Jul 2007, Andrew Yee wrote: Thanks. But in this specific case, I would like the output to include all three columns, including the ignored column (in this case, I'd like it to ignore column

[R] merging more than two data frames

2007-06-22 Thread Andrew Yee
I'm familiar with using merge() to merge two data frames. But is there functionality in R that will let you merge three or more data frames? Thanks, Andrew [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list

[R] getting tapply() to work across multiple columns

2007-06-17 Thread Andrew Yee
I have the following data.frame: index - c(a,a,b,b,b) alpha - c(1,2,3,4,5) beta - c(2,3,4,5,6) table -data.frame(index,alpha,beta) I'm now interested in getting means of alpha and beta for each of the index values and do a tapply() for each of the columns, e.g. means.alpha - tapply(table$alpha,

Re: [R] getting t.test to work with apply()

2007-06-04 Thread Andrew Yee
hand, the lapply suggestion works better. results - lapply(1:nrow(raw.sample), function(i) t.test(raw.sample [i,alive],raw.sample[i,dead])) Thanks, Andrew On 6/4/07, Peter Dalgaard [EMAIL PROTECTED] wrote: Petr Klasterecky wrote: Andrew Yee napsal(a): Hi, I'm interested in using apply

Re: [R] getting t.test to work with apply()

2007-06-04 Thread Andrew Yee
(y) I think in the end, the lapply suggestion works the best! Andrew On 6/4/07, Peter Dalgaard [EMAIL PROTECTED] wrote: Andrew Yee wrote: Thanks for everyone's suggestions. I did try results -apply(raw.sample,1,function(x) t.test(x[,alive],x[,dead])) However, I get: Error

Re: [R] getting t.test to work with apply()

2007-06-04 Thread Andrew Yee
[alive], x[dead])). In other words, function(x) t.test(x[,alive],x[,dead]) does not work. With these steps, apply works. Andrew On 6/4/07, Petr Klasterecky [EMAIL PROTECTED] wrote: Andrew Yee napsal(a): Hi, I'm interested in using apply() with t.test() on a data.frame. Specifically, I'd like

[R] getting t.test to work with apply()

2007-06-03 Thread Andrew Yee
Hi, I'm interested in using apply() with t.test() on a data.frame. Specifically, I'd like to use apply() to do the following: t.test(raw.sample[1,alive],raw.sample[1,dead]) t.test(raw.sample[2,alive],raw.sample[2,dead]) t.test(raw.sample[3,alive],raw.sample[3,dead]) etc. I tried the

[R] trouble understanding why ...==NaN isn't true

2007-05-29 Thread Andrew Yee
I have the following data: dataset[2,Sample.227] [1]NaN 1558 Levels: -0.000 -0.001 -0.002 -0.003 -0.004 -0.005 -0.006 -0.007 -0.008- 0.009 ... 2.000 However, I'm not sure why this expression is coming back as FALSE: dataset[2,Sample.227]==NaN [1] FALSE Similarly:

Re: [R] trouble understanding why ...==NaN isn't true

2007-05-29 Thread Andrew Yee
Okay, it turns out that there were leading spaces, so that in the data, it was represented asNaN, hence the expression ==NaN was coming back as false. Is there a way to find out preemptively if there are leading spaces? Thanks, Andrew On 5/29/07, Andrew Yee [EMAIL PROTECTED] wrote: I

[R] using cutree() to figure out the heatmap cluster labels on the left

2007-05-28 Thread Andrew Yee
(instead of manually going to the heatmap)? Thanks, Andrew Andrew Yee, MD MGH Cancer Center [[alternative HTML version deleted]] __ R-help@stat.math.ethz.ch mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting

[R] looking for the na.omit equivalent for a matrix of characters

2007-05-28 Thread Andrew Yee
I have a matrix of characters (actually numbers that have been read in as numbers), and I'd like to remove the NA. I'm familiar with na.omit, but is there an equivalent of na.omit when the NA are the actual characters NA? Thanks, Andrew [[alternative HTML version deleted]]

[R] trouble installing RWinEdt

2007-05-17 Thread Andrew Yee
I have been having some difficulty instaling RWinEdt 1.7-5 I've tried a couple methods, including installing the package from a zip file that I've downloaded locally. It installs fine, but then I get an error message with library(RWinEdt) as follows: library(RWinEdt) Error in getWinEdt() :

Re: [R] trouble installing RWinEdt

2007-05-17 Thread Andrew Yee
Thanks. I mistakenly didn't realize that I needed to have WinEdt installed first! Now that it's installed, the installation works fine. Andrew On 5/17/07, Uwe Ligges [EMAIL PROTECTED] wrote: Andrew Yee wrote: I have been having some difficulty instaling RWinEdt 1.7-5 I've tried

[R] naive question about using an object as the name of another object

2007-05-17 Thread Andrew Yee
This is a dumb question, but I'm having trouble finding the answer to this. I'd like to do the following: x-asdf and then have the object x.y become automatically converted/represented as asdf.y (sort of akin to macro variables in SAS where you would do: %let x=asdf and do x..y) What is the

[R] more woes trying to convert a data.frame to a numerical matrix

2007-05-16 Thread Andrew Yee
I have the following csv file: name,x,y,z category,delta,gamma,epsilon a,1,2,3 b,4,5,6 c,7,8,9 I'd like to create a numeric matrix of just the numbers in this csv dataset. I've tried the following program: sample.data - read.csv(sample.csv) numerical.data - as.matrix(sample.data[-1,-1])

Re: [R] more woes trying to convert a data.frame to a numerical matrix

2007-05-16 Thread Andrew Yee
a vector? Additionally, I've also considered: data.matrix(sample.data[-1,-1] but bizarrely, it returns: x y z 2 1 1 1 3 2 2 2 4 3 3 3 Thanks, Andrew On 5/16/07, Marc Schwartz [EMAIL PROTECTED] wrote: On Wed, 2007-05-16 at 08:10 -0400, Andrew Yee wrote: I have the following csv file

Re: [R] more woes trying to convert a data.frame to a numerical matrix

2007-05-16 Thread Andrew Yee
] wrote: On Wed, 2007-05-16 at 08:40 -0400, Andrew Yee wrote: Thanks for the suggestion and the explanation for why I was running into these troubles. I've tried: as.numeric(as.matrix(sample.data[-1, -1])) However, this creates another vector rather than a matrix. Right. That's

Re: [R] more woes trying to convert a data.frame to a numerical matrix

2007-05-16 Thread Andrew Yee
for the header and csv for the data) Of course, the above code seems kind of clunky, and welcome any suggestions for improvement. Thanks, Andrew On 5/16/07, Andrew Yee [EMAIL PROTECTED] wrote: Thanks for the suggestion. However, I've tried sapply and data.matrix. The problem is that it while

[R] converting a row of a data.frame to a vector

2007-05-15 Thread Andrew Yee
I've searched for the answer to this in the help list archive, but wasn't able to get the answer to work. I'm interested in converting a row of a data.frame into a vector. However, when I use as.vector(x,[1,]) I get another data.frame, instead of a vector. (On the other hand, when I use