**T**he function *pimax* from our package mcsm is used in to reproduce Figure 5.11 of our book *Introducing Monte Carlo Methods with R*. (The name comes from using the Pima Indian R benchmark as the reference dataset.) I got this email from Josué

I ran the ‘pimax’ example from the mcsm manual, and it gave me the following message:

> pimax(Nsim = 10^3)

Error in raaj[t, ] = apply(as.matrix(aas), 1, margap) :

number of items to replace is not a multiple of replacement length

> pimax()

Error in raaj[t, ] = apply(as.matrix(aas), 1, margap) :

number of items to replace is not a multiple of replacement length

but when running pimax(10^2) on my machine I did get the following picture and no error message. So I wonder if this is a matter of version of R or something else…

Filed under: Books, R, Statistics Tagged: Introducing Monte Carlo Methods with R, mcsm, Pima Indians, pimax, R

*Related*

To

**leave a comment** for the author, please follow the link and comment on his blog:

** Xi'an's Og » R**.

R-bloggers.com offers

**daily e-mail updates** about

R news and

tutorials on topics such as: visualization (

ggplot2,

Boxplots,

maps,

animation), programming (

RStudio,

Sweave,

LaTeX,

SQL,

Eclipse,

git,

hadoop,

Web Scraping) statistics (

regression,

PCA,

time series,

trading) and more...

If you got this far, why not

__subscribe for updates__ from the site? Choose your flavor:

e-mail,

twitter,

RSS, or

facebook...

**Tags:** Books, Introducing Monte Carlo Methods with R, mcsm, Pima Indians, pimax, R, statistics