查找/下载头文件R.h和Rmath,用于C与R接口
Locating/downloading header files R.h and Rmath for C interfacing with R
关于这个问题有许多类似的问题,但似乎没有人告诉我确切地在哪里得到R.h和Rmath.h头文件,如果我还没有它们(我已经搜索了我的计算机,它们不在那里)。这些是链接C/c++函数和R代码所必需的头文件。
简单地说,应该用哪个R包把这些头文件放到电脑上,或者我可以从哪个网站下载它们?
这个问题提到了R-devel包,但是在我的R(3.1.1)版本中似乎没有。关于Stack Overflow的其他问题可以在这里,这里和这里找到,但我认为没有直接回答问题。
感谢您的帮助。
克里斯托弗大多数Linux发行版应该有locate
:
edd@max:~$ locate Rmath.h | grep "usr/" | grep -v "local/"
/usr/include/Rmath.h
/usr/include/JAGS/JRmath.h
/usr/share/R/include/Rmath.h
edd@max:~$
(我这里有开发版本,版本控制签出和Debian软件包的源代码,因此grep
。还显示了JAGS的一个假阳性。)
最后,"官方"的方法是问R自己:
edd@max:~$ R CMD config --cppflags
-I/usr/share/R/include
edd@max:~$
它们应该在R的RHOME
文件夹下面的include
文件夹中。
$ R RHOME
/home/rowlings/Downloads/R-3.2.1
$ ls -l `R RHOME`/include
total 108
-rw-r--r-- 1 rowlings rowlings 511 Jun 29 17:34 Rconfig.h
-rw-r--r-- 1 rowlings rowlings 5916 Jun 29 17:34 Rdefines.h
-rw-r--r-- 1 rowlings rowlings 2085 Jun 29 17:34 Rembedded.h
drwxr-xr-x 2 rowlings rowlings 4096 Jun 29 17:34 R_ext
-rw-r--r-- 1 rowlings rowlings 2063 Jun 29 17:34 R.h
-rw-r--r-- 1 rowlings rowlings 4818 Jun 29 17:34 Rinterface.h
-rw-r--r-- 1 rowlings rowlings 46137 Jun 29 17:34 Rinternals.h
-rw-r--r-- 1 rowlings rowlings 17619 Jun 29 17:34 Rmath.h
-rw-r--r-- 1 rowlings rowlings 509 Jun 29 17:34 Rversion.h
-rw-r--r-- 1 rowlings rowlings 2142 Jun 29 17:34 S.h
您可以从此链接获取代码-
Rmath.hhttps://www.cs.kent.ac.uk/projects/cxxr/doc/html/Rmath_8h_source.html
R.h -https://www.cs.kent.ac.uk/projects/cxxr/doc/html/R_8h_source.html
这些头文件包含在R安装中(无论是从CRAN还是从源代码构建);你应该能够在R会话中使用R.home()
找到它们;例如
list.files(R.home("include"))
给我
> list.files(R.home("include"))
[1] "libintl.h" "R_ext" "R.h"
[4] "Rconfig.h" "Rdefines.h" "Rembedded.h"
[7] "Rinterface.h" "Rinternals.h" "Rmath.h"
[10] "Rversion.h" "S.h"
相关文章:
- 1d 智能指针不适用于语法 (*)++
- 用于修改抽象属性的接口
- 用于提供不同接口的容器的包装容器
- C++ Rcpp::接口的接口不适用于返回 std::p air 的函数
- 用于修改网络接口属性的 Win32 API
- 用于在硬件接口之间切换的最佳设计模式
- C 分开的抽象类(接口),用于某些通用读取和/或写入访问
- 如何将共享_ptr用于com接口指针
- 插件接口设计,用于无偏接口,允许任何编程语言使用它
- 用于C++库的Tcl/Tk GUI接口
- 安装程序设备接口错误 259 用于显示
- 用于独立访问器/赋值器接口的C++设计模式
- 如何在Boost serialization中创建用于序列化的接口
- Marshalas UnManagedType用于接口数组
- 用于类型转换的接口,而不是强制转换
- 用于在C++中返回集合的接口
- 查找/下载头文件R.h和Rmath,用于C与R接口
- 是否存在用于嵌套枚举类的接口机制
- 有没有办法获得正在运行或新打开的浏览器窗口的IExplorerBrowser接口,用于后续的BrowseToXXX调用
- C/C++ 图形接口,用于表示偏序