[R] Obtaining the source code

John Fox j|ox @end|ng |rom mcm@@ter@c@
Sun Jun 19 19:34:32 CEST 2022


Dear Cristofer,

 > stats:::rstandard.lm
function (model, infl = lm.influence(model, do.coef = FALSE),
     sd = sqrt(deviance(model)/df.residual(model)), type = c("sd.1",
         "predictive"), ...)
{
     type <- match.arg(type)
     res <- infl$wt.res/switch(type, sd.1 = c(outer(sqrt(1 - infl$hat),
         sd)), predictive = 1 - infl$hat)
     res[is.infinite(res)] <- NaN
     res
}
<bytecode: 0x114ed5740>
<environment: namespace:stats>

More generally, use ::: for an object that's hidden in a package namespace.

I hope this helps,
  John

On 2022-06-19 1:23 p.m., Christofer Bogaso wrote:
> Hi,
> 
> I am trying to see the source code of rstandard function. I tried below,
> 
>> methods('rstandard')
> 
> [1] rstandard.glm* rstandard.lm*
> 
> What do I need to do if I want to see the source code of rstandard.lm*?
> 
> Thanks for your help.
> 
> ______________________________________________
> R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
> 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.
-- 
John Fox, Professor Emeritus
McMaster University
Hamilton, Ontario, Canada
web: https://socialsciences.mcmaster.ca/jfox/



More information about the R-help mailing list