[R] Viewing code

2008-12-24 Thread Stephen Collins
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@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.


Re: [R] Viewing code

2008-12-24 Thread jim holtman
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_coll...@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@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?

__
R-help@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.