我正在研究包的一些功能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)
}
Run Code Online (Sandbox Code Playgroud)
因此该sobel.h
函数使用被调用的C例程sobel_h
((我认为)存储在文件中rimage.dll
).
有没有办法看到sobel_h
函数的C代码?
(我讲的rimage
是一个实际例子的包;但答案当然会推广到所有使用.C例程的包).
rcs*_*rcs 14
检查一下: Uwe Ligges.R帮助台:访问源.R News,6(4):43 - 45,2006年10月.
为了访问已编译代码的源代码(即C,C++或Fortran),仅安装R的二进制版本或贡献包是不够的.相反,有必要下载R或包的源.
rimage的Linux源代码如下:http://cran.r-project.org/src/contrib/rimage_0.5-8.1.tar.gz Windows源代码来自: http://cran.r-project.org/ 斌/窗/的contrib/R-发布/ rimage_0.5-8.1.zip
sobel.c位于解压缩文件的rimage/src /目录中.
归档时间: |
|
查看次数: |
1556 次 |
最近记录: |