Unobtainable source code of specific functions

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

Unobtainable source code of specific functions

julien.lacroix
Dear all,

I currently work on a translation of a cost surface function from R to Python for my dissertation at university. In this context, I have to understand the "AccCost" method (https://rdrr.io/cran/gdistance/src/R/accCost.R). This method calls the function "shortest.paths" among other functions. This is precisely the function that computes the cost surface so I found the source code with "getAnywhere(shortest.paths())", but my problem is that this code calls other functions that cannot be accessed with getAnywhere or on the web... These functions are "C_R_igraph_finalizer", "C_R_igraph_get_graph_id" and "C_R_igraph_shortest_paths". My question is therefore the following, how or where could I find these source code ? (Note : I have the package Igraph installed)

Thanks a lot for the help,

Julien Lacroix

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Reply | Threaded
Open this post in threaded view
|

Re: Unobtainable source code of specific functions

Ivan Krylov
On Thu, 14 Mar 2019 15:44:07 +0100 (CET)
[hidden email] wrote:

> My question is therefore the following, how or where could I find
> these source code ? (Note : I have the package Igraph installed)

Functions wrapped in .Call() are implemented in a compiled language,
with corresponding sources in the src/ directory of a package.

For example, the call to C_R_igraph_shortest_paths seems to end up in
https://github.com/igraph/igraph/blob/6faf5610b8ab0175466e93a8a1d1981987976a38/src/structural_properties.c#L460

--
Best regards,
Ivan

______________________________________________
[hidden email] mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.