#!/usr/bin/r -ti suppressMessages(library(Rcpp)) suppressMessages(library(inline)) # R function that will be called from C++ vecfunc <- function(x) { y <- x^1.05 # do a transformation print(y) # but also print plot(y, ylim=c(1,8), type='b') # and even plot Sys.sleep(0.225) # sleep before next call return(y) } # C++ source code to operate on function and vector cpp <- ' int n = as(N); NumericVector numvec(xvec) ; Function f(fun) ; for( int i=0; i