Documentation is a critical part of your product experience. GitBook helps you collaborate and build beautiful, centralized docs your users will love.

Rcpp: Seamless R and C++ Integration Synopsis The Rcpp package help to integrate R and C++ via R functions and a (header-only) C++ library. All underlying R types and objects, i.e., everything a SEXP represents internally in R, are matched to corresponding C++ objects. This covers anything from vectors, matrices or lists to environments, functions and more. Each SEXP variant is automatically mappe
6. gibbsR <- function(N,thin){ mat<-matrix(0,nrow=N,ncol=2) x <- 0 y <- 0 for(i in 1:N){ for(j in 1:thin){ x <- rgamma(1, 3, 1/(y*y+4)) y <- rnorm(1, 1/(x+1), 1/sqrt(2*x+2)) } mat[i,] <- c(x,y) } return(mat) } Rのコード例 ギブスサンプラー ついでに cmpfun でコンパイルしてみる gibbsC <- compiler::cmpfun(gibbsR) 7. Rcppのコード例 #include <Rcpp.h> using namespace Rcpp; ←これを書くとRcpp::は書かなくて良い // [[Rcpp::export]] ←この直下の関数がRに読み込まれる Rcp
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く