简体   繁体   English

访问和修改R中.C()调用的包函数

[英]Access and modify package functions called by .C() in R

I'm currently looking at the 'PlayerRatings'-package and would like to inspect and possibly modify the internals of the .C("elo", ...) -Function, which is part of this package. 我目前正在查看'PlayerRatings'软件包,并希望检查并可能修改 .C("elo", ...) - .C("elo", ...)的内部,该组件是此软件包的一部分。

I've found resources on how to write extensions in C , and on how to access C-Functions of base R , but I am still unsure, where to look for the (uncompiled) source code of a C-Function, which is part of a package in R . 我已经找到了有关如何在C中编写扩展以及如何访问基本R的C函数的资源 ,但是我仍然不确定在哪里可以找到C函数的(未编译的)源代码,这是其中的一部分R中的一个包装

Steps: 脚步:

  • Google search CRAN + Player Ratings Google搜索CRAN +播放器评分
  • On CRAN page, click and download sources link 在CRAN页面上,单击并下载源链接
  • Unpack with tar -xvzf ./PlayerRatings_1.0-0.tar.gz or some such 使用tar -xvzf ./PlayerRatings_1.0-0.tar.gz或类似的文件解压缩
  • Look at PlayerRatings/src/ratings.c (the src folder is where the C code goes). 查看PlayerRatings/src/ratings.csrc文件夹是C代码所在的位置)。

For re-build instructions look at the how to write R extensions page you link. 有关重新构建的说明,请参见链接的“如何编写R扩展”页面。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM