Yes, this post condenses 50+ hours of learning into a 15 minute tutorial. Read ’em and weep. (That is, you read while I weep.)
Continue readingTag: C
Using R — Calling C code with Rcpp
In two previous posts we described how R can call C code with .C() and the more complex yet more robust option of calling C code with .Call(). Here we will describe how the Rcpp package can be used to greatly simplify your C code without forcing you to become expert in C++.
Continue readingUsing R – .Call(“hello”)
In an introductory post on R APIs to C code, Calling C Code ‘Hello World!’, we explored the .C() function with some ‘Hello World!’ baby steps. In this post we will make a leap forward by implementing the same functionality using the .Call() function.
Continue readingUsing R – Calling C code ‘Hello World!’
One of the reasons that R has so much functionality is that people have incorporated a lot of academic code written in C, C++, Fortran and Java into various packages. Libraries written in these languages are often both robust and fast. If you are using R to support people in a particular field, you may be called upon to incorporate some outside code into your R environment. Unfortunately, much of the documentation on how to do this is written at a very high level. In this post we will distil some of the available information on calling C code from R into three “Hello World” examples.
Continue reading