.Call used to pass variables to C. subroutines. C_cov is a variable (in the stats namespace that we will see soon) that tells .Call where to find the subroutine that it should use to calculate covariance.
If you type C_cov at the command line, you will get
Error: object 'C_cov' not found
This is because it is hidden from you. You will need to do a little detective work.
getAnywhere('C_cov')
This tells us that in the stats namespace there is a variable called C_cov (your result may be slightly different from this). Let's try to get it.
stats::C_cov
Apparently C_cov not intended for public consumption. Everything is in order, we still get:
stats:::C_cov # use three colons to get unexported variables. # $name # [1] "cov" # # blah, blah, blah ... # $dll # DLL name: stats # Filename: C:/Program Files/R/R-3.0.1/library/stats/libs/x64/stats.dll # Dynamic lookup: FALSE # # blah, blah, ...
What we want. He tells us the name of the subroutine and library. Now we just need to go to the C source and follow the trail: ... / src / library / stats / src / cov.c
Matthew plourde
source share