I'm trying to view a source code. For example for cook.distance(). This is what I have tried
cooks.distance
function (model, ...)
UseMethod("cooks.distance")
<bytecode: 0x3f25b5c>
<environment: namespace:stats>
then i tried:
debug(cooks.distance)
and got nothing. Then I tried:
methods(cooks.distance)
[1] cooks.distance.glm* cooks.distance.lm*
Non-visible functions are asterisked
then I tried:
lm:::cooks.distance.default
Error in loadNamespace(name) : there is no package called ‘lm’
someone told me lm was in the MASS package so I tried the following:
MASS:::cooks.distance.default
Error in get(name, envir = asNamespace(pkg), inherits = FALSE) :
object 'cooks.distance.default' not found
how can I view the source code? I tried to look in the source code but could not locate the function?