\begin{Schunk}
\begin{Sinput}
 ## Make a wrapper function
 oneSim <- function(rep, N = 100, M1 = 103, M0 = 98, SD1 = 15, SD0 = 15){
     getDiff(getData(1, N = N, M1 = M1, M0 = M0, SD1 = SD1, SD0 = SD0))
  }
 set.seed(123)
 myMeanDiffs <- vapply(1:2000, oneSim, N = 100,
                        M1 = 103, M0 = 98, SD1 = 15, SD0 = 15,
                        numeric(1))
 ## check results
 mean(myMeanDiffs)
\end{Sinput}
\begin{Soutput}
[1] 4.920373
\end{Soutput}
\begin{Sinput}
 sd(myMeanDiffs)
\end{Sinput}
\begin{Soutput}
[1] 3.073736
\end{Soutput}
\end{Schunk}
