[Rd] how to add method to .Primitive function

Vadim Ogranovich vograno at evafunds.com
Sat May 7 17:30:49 CEST 2005


Hi,
 
I tried to write the dim method for the list class, but R doesn't seem
to dispatch to it:
> dim.list = function(x) c(length(x[[1]]), length(x))
> dim(list(1))
NULL
> dim.list(list(1))
[1] 1 1

What is the correct way of registering dim.list with .Primitive("dim")?
 
Thanks,
Vadim
 
 

	[[alternative HTML version deleted]]



More information about the R-devel mailing list