I develope a package using Rcpp, cpp include "windows.h" library, but this package is not available on Linux, so I decided to achieve the same function using reticulate package to call python package, how should I make package detect installed on which platform ? If on Windows platform, installing my package will compile cpp file , if on Linux , installing my package will not compile cpp file but using my r code inside. For example:
Windows:
myfunction<-function(){
.Call(C++ function)
}
And also avoid compile cpp file in src folder or there will be error : "no windows.h library"
Linux:
myfunction<-function(){
library(reticulate)
import(py_package)
}