I have read the description but i am still confuse by the role of the .Internal
function. Because it works fine with .Internal(body(mean))
but not with .Internal(mean)
. I presume that this is written in c++ and is compiled, but it is possible to see the code? In what folder of the R folder is?
Thanks in advance
We can find the functions inside a package by using lsf.
What is an internal function? It's a function that lives in your package, but that isn't surfaced to the user. You could also call it unexported function or helper function; as opposed to exported functions and user-facing functions. For instance, in the usethis package there's a. base_and_recommended()
Every time you start a new R session you'll need to load the packages/libraries that contain functions you want to use, using either library() or require() . If you load a package with the same function name as in another package, you can use packageName::functionName() to call the function directly.
You can view the c source code with this:
pryr::show_c_source(.Internal(mean()))
From @Dominic Comtois post here, "the show_c_source
function will search on GitHub for the relevant piece of code in the C source files. Works for .Internal and .Primitive functions."
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With