Re: [R] Stumped on methods

From: Roger D. Peng <rpeng_at_jhsph.edu>
Date: Fri 16 Jul 2004 - 22:22:10 EST

If a method is hidden in a namespace, use getAnywhere(print.whatever) to see the code.

-roger

Jim Lemon wrote:
> I have been trying to write a "proper" print method for a package, and have
> almost gotten what I want. From a reading of the relevant section in R
> Extensions and the introduction to methods, I've stuck the whole business
> into a character object and used:
>
> NextMethod("print")
>
> However, instead of not printing quotes and displaying the usual
> representation of the string, I get the whole string, newlines and all, in
> quotes. My attempt to shamelessly copy someone else's print method
> was foiled as most of them don't display when one types the function name. I
> presume this is a feature of namespaces.
>
> Needless to say, searching the archives for "print & method" retrieved a
> cornucopia of useless information. I wonder if anyone would be kind enough to
> inform me where to look for the proper incantation? Thanks.
>
> RedHat EL3 L:inux
> R-1.9.1
> Last.Drink - Aurora Expresso
>
> Jim
>
> ______________________________________________
> R-help@stat.math.ethz.ch mailing list
> https://www.stat.math.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html
>



R-help@stat.math.ethz.ch mailing list
https://www.stat.math.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide! http://www.R-project.org/posting-guide.html Received on Fri Jul 16 22:34:23 2004

This archive was generated by hypermail 2.1.8 : Wed 03 Nov 2004 - 22:55:02 EST