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.

New function<br />

• sapply<br />

• Takes first argument, and calls second<br />

argument one at a time<br />

•<br />

•<br />

•<br />

•<br />

sapply(1:10, sum) vs sum(1:10)<br />

sapply(1:10, function(n) mean(rnorm(n))<br />

mean

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

Saved successfully!

Ooh no, something went wrong!