Uwe Ligges wrote an "R Help Desk" article on this very topic in R News (2006, 6(4):43-45).
Once you've identified the actual C function that is used, then use your filesystem search tools to search for the function name in the relevant source folder; in this case ./src/main/
, e.g. on Linux
$ grep -r -H "do_matchcall" ./src/main/
./src/main/.svn/text-base/names.c.svn-base:{"match.call", do_matchcall, 0, 11, 3, {PP_FUNCALL, PREC_FN, 0}},
./src/main/.svn/text-base/unique.c.svn-base:SEXP attribute_hidden do_matchcall(SEXP call, SEXP op, SEXP args, SEXP env)
./src/main/unique.c:SEXP attribute_hidden do_matchcall(SEXP call, SEXP op, SEXP args, SEXP env)
./src/main/names.c:{"match.call", do_matchcall, 0, 11, 3, {PP_FUNCALL, PREC_FN, 0}},
indicating that unique.c
is the place to look in this case.
To the best of my knowledge, there is no way (other than invoking a system call to the terminal) to identify from within R which source file contains the C code for a given function in R - well, not without rewriting grep
or find
or similar using R code :-)