Re: [R] generic functions question in building a new package

2012-07-20 Thread Uwe Ligges
On 19.07.2012 22:44, zgu9 wrote: Hi all, I'm trying to build a package 'Thiele', but run into problems with generic functions. I have a class "Benefit", and defined the function "print.Benefit". When I try "R CMD check Thiele" in X11, this warning came out --- Functions/methods with usage

Re: [R] Generic Functions and Dates

2011-01-31 Thread Martin Morgan
On 01/31/2011 12:15 PM, Elliot Joel Bernstein wrote: > I'm trying to write a generic function that calls different methods > depending on the structure of the argument, but not the exact type of > its contents. For example, the function 'nan2last' below works for a > numeric vector but not for a ve

Re: [R] Generic Functions

2008-02-24 Thread Martin Morgan
See the 'useAsDefault' argument to setGeneric. As an aside, if 'setType<-' is meant to be a 'setter' to change the value of a slot 'type', then I find the syntax a little redundant -- it's use > setType(x) <- "foo" implies that it is already a 'setter' without 'set' at the front. Why not jus