Re: [R] help needed on function call

2008-03-04 Thread rmail ye
Thanks for your help. By adding { eval(substitute(var)) }, it works for me. Patrick advise me not attaching a dataset in a function. I will try to avoid this. Best, Sean On Tue, Mar 4, 2008 at 11:15 AM, Erik Iverson <[EMAIL PROTECTED]> wrote: > It isn't clear to me what output you would like to

Re: [R] help needed on function call

2008-03-04 Thread Erik Iverson
It isn't clear to me what output you would like to have by your description. However, there certainly is a clearer way of getting there than your functions. If you better define what output you'd like to have (i.e., what your table should look like), I may be able to offer some suggestions. Y

[R] help needed on function call

2008-03-04 Thread rmail ye
Hi there, I am confused about fucntion call. After defining a function, I called it within another function. dt<-cars; #a copy of R internal dataset "cars" created; dt$cat1<-ifelse(dt$speed<20,0,1); dt$ind<-ifelse(dt$speed<15,1,2); #group variable; freqtot <- function(data,var){ atta