0

I want to see the function starting with a underscore, for instance

invisible(.Call("_function"))

But when I use

getAnywhere("_function")

no result is shown. Can anyone help me?

  • Does this answer your question? [Export all hidden functions from a package](https://stackoverflow.com/questions/37832869/export-all-hidden-functions-from-a-package) – Mark Jul 11 '23 at 09:36
  • 1
    (1) the name starts with an underscore, not a dot. (2) this is not an R function, therefore `getAnywhere` does not find it (`.Call` does not expect an R function name! — see `?.Call`). (3) this is unrelated to the leading underscore. – Konrad Rudolph Jul 11 '23 at 09:36
  • 2
    @Mark No, that’s unrelated. But I just checked the answer to that question and it’s horrifyingly bad anyway. :-( – Konrad Rudolph Jul 11 '23 at 09:37
  • Thank you so much! I see why this happens. So I cannot view the code in R, can I? – Nicolas Fabre Jul 11 '23 at 09:55
  • 2
    Since it refers to compiled code, the source code corresponding to that name is not even shipped with R, so you cannot see it in R. What you *can* do is consult the source code of the package where this name is defined (or the [core R source code](https://github.com/wch/r-source/tree/trunk/src) – for base R C symbols, the name mappings can be found in `main/names.c`, after which you can search for the function name). – Konrad Rudolph Jul 11 '23 at 09:58
  • The canonical [How can I view the source code for a function?](https://stackoverflow.com/questions/19226816/how-can-i-view-the-source-code-for-a-function) has plenty of informations for finding code that uses `.Call`. Check out that page. – MrFlick Jul 11 '23 at 13:22

0 Answers0