[R] Viewing code
jim holtman
jholtman at gmail.com
Wed Dec 24 18:53:51 CET 2008
since 'glm' is an object, just type its name at the command prompt:
> glm
function (formula, family = gaussian, data, weights, subset,
na.action, start = NULL, etastart, mustart, offset, control =
glm.control(...),
model = TRUE, method = "glm.fit", x = FALSE, y = TRUE, contrasts = NULL,
...)
{
call <- match.call()
if (is.character(family))
family <- get(family, mode = "function", envir = parent.frame())
if (is.function(family))
family <- family()
if (is.null(family$family)) {
print(family)
stop("'family' not recognized")
}
...
On Wed, Dec 24, 2008 at 12:49 PM, Stephen Collins
<Stephen_Collins at aon.com> wrote:
> How do you view the code for a built-in R command (i.e., if I want to see
> what R is doing when I run a glm() statement)?
>
> Regards,
>
> Stephen
>
> [[alternative HTML version deleted]]
>
> ______________________________________________
> R-help at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>
--
Jim Holtman
Cincinnati, OH
+1 513 646 9390
What is the problem that you are trying to solve?
More information about the R-help
mailing list