\begin{Schunk}
\begin{Sinput}
 ## Now apply it 10 times to see the format of the output
 sim10 <- sapply(1:10, runOneSim, N = "30:30", M = "98:103", SD = "15:15")
 sim10
\end{Sinput}
\begin{Soutput}
 [1] 5.655317e-02 3.943166e-04 1.184527e-01 3.095466e-01 8.163624e-02 4.154827e-05 4.396998e-01
 [8] 5.338259e-01 3.253789e-01 2.306124e-01
\end{Soutput}
\begin{Sinput}
 ## Oops, I did not snatch the attributes for records. 
 ## Oops, I also forgot to store the rejection decision, so insert it
 
 runOneSim <- function(rep, N, M, SD){
      dframe <- getTdata(rep, N = N, M = M, SD = SD)
      reslt <- conductTtest(dframe)
      parms <- attr(dframe, "parms")
      dframe2 <- data.frame(rep = attr(dframe, "rep"), 
                 pvalue = reslt, reject = if (reslt <= 0.05) 1 else 0,
                 N = parms["N"], M = parms["M"], SD = parms["SD"])
  	dframe2
  }
 ## test that
 runOneSim(1, N = "30:30", M = "98:103", SD = "15:15")
\end{Sinput}
\begin{Soutput}
  rep    pvalue reject     N      M    SD
N   1 0.1556859      0 30:30 98:103 15:15
\end{Soutput}
\end{Schunk}
