[R] Inspecting R functions

Fredrik Lundgren fredrik.bg.lundgren at bredband.net
Mon Jan 3 12:07:56 CET 2005


Richard,

There are usually several methods available - depending on the class of 
the object you apply 'hist' on.
In this case two are 'non-visible'

######
> methods(hist)
[1] hist.Date*   hist.default hist.POSIXt*

    Non-visible functions are asterisked
######

Probably you are interested in hist.default

######
> hist.default
function (x, breaks = "Sturges", freq = NULL, probability = !freq,
    include.lowest = TRUE, right = TRUE, density = NULL, angle = 45,
    col = NULL, border = NULL, main = paste
...
snip
...
    }
    else r
}
<environment: namespace:graphics>

######

Fredrik Lundgren

----- Original Message ----- 
From: "Richard Dybowski" <richard at inferspace.com>
To: <r-help at stat.math.ethz.ch>
Sent: Monday, January 03, 2005 11:50 AM
Subject: [R] Inspecting R functions


> 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?
>
> -------------------------------
> Richard Dybowski
> 143 Village Way
> Pinner HA5 5AA, UK
> Tel: 07976 250092
>
> ______________________________________________
> R-help at stat.math.ethz.ch mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide! 
> http://www.R-project.org/posting-guide.html
>




More information about the R-help mailing list