【发布时间】:2018-09-27 21:26:53
【问题描述】:
我想知道在 R 中获取任何辅助(以区别于原始/内部)函数的 C/C++ 源代码的正确方法是什么。 相关问题有here、here、here和here:
我的不同,所以我在我的问题中使用了“secondary”。 例如,read.table() 函数,在 R 控制台中我得到了:
>?read.table
read.table package:utils R Documentation
Data Input
Description:
Reads a file in table format and creates a data frame from it,
with cases corresponding to lines and variables to fields in the
file.
Usage:
read.table(file, header = FALSE, sep = "", quote = "\"'",
......
或者
> getAnywhere(read.table)
A single object matching ‘read.table’ was found
It was found in the following places
package:utils
namespace:utils
with value
function (file, header = FALSE, sep = "", quote = "\"'", dec = ".",
......
attr(data, "row.names") <- row.names
data
}
<bytecode: 0x560ff88edd40>
<environment: namespace:utils>
搜索我得到的网站:
https://svn.r-project.org/R/trunk/src/library/utils/src/utils.c
https://svn.r-project.org/R/trunk/src/library/utils/src/utils.h
如果合理的话,如何获取read.table函数的C/C++源代码而不是R代码?
【问题讨论】:
-
有 c/c++ 代码吗?我在svn.r-project.org/R/trunk/src/main/names.c 中什么也没看到
-
这是我应该知道的另一个线索。我不知道 names.c 可以提供一些信息。谢谢!