Re: [R] Something wrong with my function Please Help

2009-09-29 Thread Jim Lemon
On 09/29/2009 01:29 PM, Chunhao Tu wrote: Hi R users, I try to build a function to compute odds ratio and relative risk however something wrong. I stuck for many hours but I really don't know how to solve it. Would someone please give me a hint? OR.RR<-function(x){ + x<- as.mat

Re: [R] Something wrong with my function Please Help

2009-09-29 Thread Corrado
Did you run debug over your function? Load the library debug, and then run mtrace over your function. library(debug) ? mtrace hth On Tuesday 29 September 2009 04:29:37 Chunhao Tu wrote: > Hi R users, > I try to build a function to compute odds ratio and relative risk however > something wrong.

Re: [R] Something wrong with my function Please Help

2009-09-29 Thread Paul Hiemstra
Chunhao Tu wrote: Hi R users, I try to build a function to compute odds ratio and relative risk however something wrong. I stuck for many hours but I really don't know how to solve it. Would someone please give me a hint? OR.RR<-function(x){ + x <- as.matrix(any(dim(x)==2)) +

Re: [R] Something wrong with my function Please Help

2009-09-29 Thread Barry Rowlingson
On Tue, Sep 29, 2009 at 4:29 AM, Chunhao Tu wrote: > > Hi R users, > I try to build a function to compute odds ratio and relative risk however > something wrong. I stuck for many hours but I really don't know how to solve > it. Would someone please give me a hint? > >> OR.RR<-function(x){ What i