[R] How to figure out which the version of split is used?

Patrick Connolly p_connolly at slingshot.co.nz
Thu Dec 10 10:48:08 CET 2009


On Wed, 09-Dec-2009 at 07:20PM -0600, Peng Yu wrote:

|> There are a number of functions that are dispatched to from split().
|> 
|> > methods('split')
|> [1] split.data.frame split.Date       split.default    split.POSIXct
|> 
|> Is there a way to figure out which of these variants is actually
|> dispatched to when I call split? I know that if the argument is of the
|> type data.frame, split.data.frame will be called? Is it the case that

In R-speak, "class" would be a better word than "type".  

|> if the argument is not of type data.frame, Date or POSIXct,
|> split.default will be called?

I think it's slightly more complicated than that, but you're more or
less on the right track.

HTH

-- 
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.   
   ___    Patrick Connolly   
 {~._.~}                   Great minds discuss ideas    
 _( Y )_  	         Average minds discuss events 
(:_~*~_:)                  Small minds discuss people  
 (_)-(_)  	                      ..... Eleanor Roosevelt
	  
~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.~.




More information about the R-help mailing list