gpt4 book ai didi

c++ - 如何获取R的二级函数的C/C++源代码?

转载 作者:太空宇宙 更新时间:2023-11-04 01:46:42 25 4
gpt4 key购买 nike

我想知道在 R 中获取任何辅助函数(以区别于原始/内部函数)的 C/C++ 源代码的正确方法是什么。相关问题是here , here , herehere :

我的不同,所以我在问题中使用了“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代码,是否合理?

最佳答案

可搜索的 R 源代码位于 https://github.com/wch/r-source对此非常有用:

所以你在这里:read.table 的底层 C 实现可以在 src/main/scan.c 中找到,从函数 do_scan 开始

关于c++ - 如何获取R的二级函数的C/C++源代码?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52545380/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com