I am looking to find the C source code for the cor() function in the R Stats package.
I've done some digging but I have hit a wall.
Looking at the source code on GitHub (https://github.com/SurajGupta/r-source/blob/master/src/library/stats/R/cor.R) I can see that the cor() wrapper function in R eventually calls C with
.Call(C_cor, x, y, na.method, FALSE)
So I thought, okay let's find C_cor(). But I can't find it anywhere. Oddly, if you search the entire code base for the stats package, there is no C function called C_cor...
Using get("C_cor", asNamespace("stats"))
gets me the path:
/usr/local/Cellar/r/3.4.3/lib/R/library/stats/libs/stats.so
I want to find the C code used to compile this, how can I do that?