Possible Duplicate:
Using 3rd party header files with Rcpp
Note: This is a continuation of a discussion started here: Using 3rd party header files with Rcpp. However, the question is different enough that I thought I would pose it as its own question.
I have a header file called coolStuff.h
that contains a function awesomeSauce(arg1)
that I would like to call in the cpp files that are in my R package.
Package Structure:
packageName
- DESCRIPTION
[man]
NAMESPACE
- R
- someRscript.R
- src
- theCppFile.cpp
- otherCppFile.cpp
The Code for theCppFile.cpp:
`#include <Rcpp.h>
using namespace Rcpp;
// [[Rcpp::export]]
double someFunctionCpp(double someInput){
double someOutput = awesomeSauce(someInput);
return someOutput;`
1) Where should I place coolStuff.h
in the package directory structure so that when the package is built, and the cpp files are compiled, the code from coolStuff.h will be included.
2) How should I call this file in the coolStuff.h
?
3) Similarly, if I want to call otherCppFile.cpp
in theCppFile.cpp
where do
Thanks again for your help. I learned a lot from the last conversation. If there is standard documentation for some of this somewhere I'll be happy to RTFM, just point me in the right direction.