1

I'm fairly new to R, so apologies if this is a basic question! I'm trying to find the source code for the bluster package build_snn_rank. I tried

bluster:::build_snn_rank

which returned:

function (neighbors) 
{
    .Call("_bluster_build_snn_rank", PACKAGE = "bluster", neighbors)
}
<bytecode: 0x7fc0e311c080>
<environment: namespace:bluster>

Usually for Primitive or similar functions, I'm able to find the code on GitHub or after a Google search, but bluster is a pretty new package. I'm not sure if this one is also calling a C++ function like many others I've worked with. I tried checking exported objects from Rcpp, RcppAnnoy, etc. but couldn't find it.

I'm using R4.1 on MacOS for this one. I have Ubuntu on Parallels VM with R3.6 too, but bluster isn't available for 3.6.

In general, I have not had success finding the source codes for function like this without searching directly online. I can't find a "names.C" file anywhere on either system, either. Searching the HD for names of these functions doesn't yield anything typically. Is there an easier way to find these functions or are they just hidden? Thanks!

Ðаn
  • 10,934
  • 11
  • 59
  • 95
Faraz
  • 11
  • 1

1 Answers1

0

Assuming this is the library in question, here is every mention build_snn_rank on github.

Edit: from my understanding, the function definition is in build_snn.cpp

  • Got it, thanks! I also just checked my bluster folder on my HD, and there's no src folder. Is that generally the case? In other words, to find CPP source code for R functions like this, it's best to check the GitHub repo for the package and then go to /src? – Faraz Aug 10 '21 at 17:17
  • For open source libraries, this is typically my preferred way to go, but it varies. Obviously if a library isn't open source, this method won't work. I also don't typically go /src, but rather just search up the function name in the search bar and let github do the the rest of the work for me. – Wickedlizerd Aug 10 '21 at 19:33