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

[R] Generic Functions and Dates

2011-01-31 Thread Elliot Joel Bernstein
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 vector of Date objects. Is there any way to make it work on