How to install/locate R.h and Rmath.h header files?

前端 未结 3 1727
慢半拍i
慢半拍i 2021-01-11 14:55

I am trying to compile some C code (called rand_beta) in terminal which contains the lines to include R.h and Rmath.h header files using gcc -o rand_beta rand_beta.c

3条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2021-01-11 14:59

    The other answers try to guess where your R installation directory is. But there is a more robust solution. Use the R.home command in R to find it wherever it is:

    > R.home('include')
    /usr/lib64/R/include
    

    That is the folder containing R.h and Rmath.h on my system. Your folder may be in a different place.

提交回复
热议问题