[R] Inspecting R functions

Prof Brian Ripley ripley at stats.ox.ac.uk
Mon Jan 3 12:17:17 CET 2005


On Mon, 3 Jan 2005, Richard Dybowski wrote:

> In S-Plus, I can look at the structure of a function (for example, hist) 
> simply by entering
>        hist <RETURN>
> however, if I do this in R, I get the response
>        function (x, ...)
>        UseMethod("hist")
>        <environment: namespace:graphics>
> How can I inspect the structure of a function in R?

I think you mean `read the code', as S-PLUS has inspect() that does 
something different, and you don't want the internal structure, do you?

You have! hist() in R is generic, and it is not in S-PLUS.

See also ?methods and ?getAnywhere,

-- 
Brian D. Ripley,                  ripley at stats.ox.ac.uk
Professor of Applied Statistics,  http://www.stats.ox.ac.uk/~ripley/
University of Oxford,             Tel:  +44 1865 272861 (self)
1 South Parks Road,                     +44 1865 272866 (PA)
Oxford OX1 3TG, UK                Fax:  +44 1865 272595




More information about the R-help mailing list