r - 如何显示 R 函数使用的 .C 例程的代码?

标签 r

我正在研究包rimage的一些功能.例如,如果您想查看 sobel.h 的代码函数,你得到:

> library(rimage)
> sobel.h
function (img) 
{
    w <- dim(img)[2]
    h <- dim(img)[1]
    imagematrix(abs(matrix(.C("sobel_h", as.double(img), as.integer(w), 
        as.integer(h), eimg = double(w * h), PACKAGE = "rimage")$eimg, 
        nrow = h, ncol = w)), noclipping = TRUE)
}

所以sobel.h函数使用名为 sobel_h 的 C 例程, ((我认为)存储在文件 rimage.dll 中)。

有什么办法可以看到sobel_h的C代码吗?功能?

(我说的是包 rimage 作为一个实际例子;但答案当然会推广到所有使用 .C 例程的包)。

最佳答案

检查这个:
Uwe Ligges. R Help Desk: Accessing the sources. R News, 6(4):43-45, October 2006.

In order to access the sources of compiled code (i.e., C, C++, or Fortran), it is not sufficient to have the binary version of R or a contributed package installed. Rather, it is necessary to download the sources for R or for the package.

关于r - 如何显示 R 函数使用的 .C 例程的代码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4174288/

相关文章:

r - 根据Shiny上的单选按钮选择禁用textInput

R:ggplot背景渐变着色

r - 连接列名和 R 中的第一行

r - 如何切换 Shiny 数据表中显示的页面?

r - 关于 .Rbuildignore 正确使用 devtools 和/或 RStudio

在 R 中删除或查找 NaN

删除 3 位数字后的部分字符串

网络抓取时的 R 内存管理

r - 如何测量y的长度?

r - 为什么表达式 "1"==1 的计算结果为 TRUE?