11.08.2013 Views

Simulation - Hadley Wickham

Simulation - Hadley Wickham

Simulation - Hadley Wickham

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Repetition<br />

• Use the replicate function<br />

• replicate(n, expression)<br />

• replicate(10, mean(rnorm(100)))<br />

• qplot(replicate(100, mean(rnorm(10))),<br />

type="histogram")

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!