benchmarks: Benchmark R and Rcpp functions.

Description Examples

Description

Use R package microbenchmark to compare the performance of C functions (gibbsR and vaccR) and Cpp functions (gibbsC and vaccC).

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
## Not run: 
data(data)
attach(data)
tm1 <- microbenchmark::microbenchmark(
  rnR = gibbsR(100,10),
  rnC = gibbsC(100,10)
)
print(summary(tm1)[,c(1,3,5,6)])

tm2 <- microbenchmark::microbenchmark(
  vR = vaccR(age,female,ily),
  vC = vaccC(age,female,ily)
)
print(summary(tm2)[,c(1,3,5,6)])

## End(Not run)

hudie-lab/StatComp documentation built on Jan. 3, 2020, 12:15 a.m.