library(Rcpp)
library(RUnit)
sourceCpp(system.file("tests/cpp/distance.cpp", package = "RcppParallel"))
test.distance <- function() {
n <- 1000
m <- matrix(runif(n*10), ncol = 10)
m <- m/rowSums(m)
checkEquals(
rcpp_js_distance(m),
rcpp_parallel_js_distance(m)
)
}
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.