Re: [R] help with formula and data= argument

2009-04-05 Thread Gabor Grothendieck
Try adding this line: label <- eval(substitute(label), df, environment(formula)) On Sat, Apr 4, 2009 at 6:27 PM, Derek Ogle wrote: > Sorry for posting this twice, but I still have not solved this problem > and am hoping for some assistance. > > > > I am attempting to write a function that is fl

Re: [R] help with formula and data= argument

2009-04-05 Thread baptiste auguie
Hi, It seems to me that you could write a generic function myplot() and have different methods for each class of object (like plot does). Either S3 or S4 classes would do I think. Then it is only a matter of making each method work separately. In particular, the method for a formula coul

[R] help with formula and data= argument

2009-04-04 Thread Derek Ogle
Sorry for posting this twice, but I still have not solved this problem and am hoping for some assistance. I am attempting to write a function that is flexible enough to respond to the user providing a formula (with a data= argument) or not (similar to plot(x,y) versus plot(y~x,data=data)). I h