title: Link Rcpp with C code for Adaptive Metropolis rejection sampling
body: <p>I'd like to use Adaptive Metropolis rejection sampling(AMRS) for my Gibbs sampling. I could use the package <code>HI</code> in R directly and use the algorithm. However, since I have too many parameters, sampling one by one in a loop in R is rather slow. So I am considering writing the whole sampling part in Rcpp. The problem is how to use the AMRS function in Rcpp. One choice is find a way to use the R function in Rcpp, but it will be slow. Then I found the original C code in the page </p>
  
  <p>[1]: AMRS <a href="http://www1.maths.leeds.ac.uk/~wally.gilks/adaptive.rejection/web_page/Welcome.html" rel="nofollow">http://www1.maths.leeds.ac.uk/~wally.gilks/adaptive.rejection/web_page/Welcome.html</a></p>
  
  <p>So the question become how to integrate the C code with Rcpp. When I'm searching around "call C in C++", those are all about compile C first, then C++, then link. However I don't know how to do that in Rcpp since the compilation happens when I was using SourceCpp. Anyone can give me some suggestions how to achieve that? </p>