Search code examples
rfunctioncallgenetic-algorithm

R how to get the function definition when call inside other function


result <- .Call("mcga", popsize, chsize, crossprob, mutateprob, 
    elitism, minval, maxval, maxiter, par, best, evalFunc, 
    population, costs, envv, PACKAGE = "mcga")

how to get the mcga function definition in R, mcga is a R package for genetic algorithm.


Solution

  • .Callis used to call compiled code (dll or equivalent). The only way is to retrieve the source package (the .tar.gz), uncompress and have a look at the source code -- Cf https://cran.r-project.org/web/packages/mcga/index.html; uncompress and have a look at "src" folder (seems to be C code in that case)