0

I'm trying to see the source code for a C file that is used in an R function.

Specifically, it is the fft() function in R. I checked for the fft source with the normal method:

> fft
function (z, inverse = FALSE) 
.Call(C_fft, z, inverse)
<bytecode: 0x0000000008c9e328>
<environment: namespace:stats>

But, .Call suggests that it's actually the C_fft file I'm interested in. However, I have no idea how to find this. I know there's the download.packages() option as per this link. However, the fft()package is in the base package "stats" and in the stats.ll, either of which seem to be available for download.

Thanks for any help.

Edit: Thanks to the first comment for letting me know I'm an idiot who should be more careful.

So in the link I posted, I know it suggests doing the following:

> stats:::C_fft
$name
[1] "fft"

$address
<pointer: 0x00000000003d1ef0>
attr(,"class")
[1] "RegisteredNativeSymbol"

$dll
DLL name: stats
Filename: C:/Program Files/R/R-3.1.0/library/stats/libs/x64/stats.dll
Dynamic lookup: FALSE

$numParameters
[1] 2

attr(,"class")
[1] "CallRoutine"      "NativeSymbolInfo"

That isn't particularly helpful.

However, the Subversion repository allows for a look through all the source files. I found mine in /src/library/stats/src.

Thanks!

Community
  • 1
  • 1
bocks
  • 35
  • 7
  • 2
    The answer to the question you linked to tells you how to view source code of packages that are installed with R. It even gives an example how to find the source code for a "stats" function. – Joshua Ulrich Apr 17 '14 at 19:58
  • Yes, I see that now. Silly of me to miss it. Thanks! – bocks Apr 17 '14 at 20:55

0 Answers0