To find a demo associated with the Rmpi package, we could issue the following two lines:
library(Rmpi) demo()
After hitting Enter, we will see the following output:
For the first function, called cslavePI, we know that we should copy cslavePI.c in Rmpi library directory to your working directory and compile it as mpicc -o cslavePI cslavePI.c. To find the path of Rmpi, we issue the find.package() function (refer to the code and the result in the following code):
> find.package("Rmpi") [1] "C:/Users/yany/Documents/R/win-library/3.4/Rmpi"
Note that different readers will get quite different paths. We can use demo(cslavePI) to ...