Rcpp and inline example

Following up on yesterday's
Rcpp 0.7.0
release, here is a quick example of why the new feastures can be so useful.

The following R code defines a character
variable gslrng. This variable contains a short C++ code
segment, which is then transformed by the function cfunction
into a function of two arguments assigned to funx:

The signature argument to cfunction defines two
variables s and n -- which the C++ function then
reads in from R and converts to two integers seed and
len.
seed is used to initialize the random-number generator, and
len draws are then taken and stored in the STL vector
v which returned at the end.

As the R level, we now have a function of two arguments returning a vector of
RNG draws of the given lenth and using the given seed.

Also note how we tell cfunction to add the GSL include line,
specify that we want to compile and link against Rcpp and provide
-I and -L arguments to compile and link with the
GSL. (The include statement is not needed as the compiler would have found them
in /usr/include anyway, but it shows how to set this if needed.)

Finally, we simply call our freshly compiled, linked and loaded C++
function with arguments zero for the seed and five for the length, and print
the results vector returned to R from C++.