Hi I looked in the "writing R extensions" and also into package.skeleton, but could not find anything: I am looking for a skeleton or simple example on how to create a package which contains C++ code. I only want to implement one function, so nothing complicated. The idea is to use the package to make it easier to install the function on several Linux computers - no windows required at the moment. Thanks, Rainer -- Rainer M. Krug, PhD (Conservation Ecology, SUN), MSc (Conservation Biology, UCT), Dipl. Phys. (Germany) Centre of Excellence for Invasion Biology Faculty of Science Natural Sciences Building Private Bag X1 University of Stellenbosch Matieland 7602 South Africa
On 19 November 2008 at 18:44, Rainer M Krug wrote: | I looked in the "writing R extensions" and also into package.skeleton, | but could not find anything: | | I am looking for a skeleton or simple example on how to create a | package which contains C++ code. | | I only want to implement one function, so nothing complicated. The | idea is to use the package to make it easier to install the function | on several Linux computers - no windows required at the moment. Yes, the Rcpp package from CRAN. Start with help("Rcpp-package", package="Rcpp") Comments on where the documentation is not clear are welcome. More about Rcpp is e.g. at http://dirk.eddelbuettel.com/code/rcpp.html Dirk -- Three out of two people have difficulties with fractions.
Rainer M Krug wrote:> Hi > > I looked in the "writing R extensions" and also into package.skeleton, > but could not find anything: > > I am looking for a skeleton or simple example on how to create a > package which contains C++ code. > > I only want to implement one function, so nothing complicated. The > idea is to use the package to make it easier to install the function > on several Linux computers - no windows required at the moment. > > Thanks, > > RainerHi Rainer, you can download a minimal R package with C source from here: http://www.simecol.de/pkg/cpackage_0.1.tar.gz You can also include C++ files in src/ if you provide plain C interfaces as described in "Writing R Extensions". Hope that helps ... Thomas P.