How to use useDynLib() correctly in an R package namespace file

时光毁灭记忆、已成空白 提交于 2019-11-30 06:55:06

You want the name of the package as the argument, as that is the name of the shared object built by R, eg useDynLib("chron"). The quotes are optional (as they are for library() etc).

I also recommend not using a Makefile, but simply dropping the C and Fortran files in the src/ directory. R is generally smart enough to know what to. If you need -I etc switches you can set them there.

Lastly, use CRAN. There are hundreds of packages with compiled sources, and some are bound to be similar in structure to your question.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!