Q:

How to run a program 100 times in R?

The script calls another script that contains functions and then has a bunch of random vectors generated that run through the functions and ends up giving the difference between the two means. 
I want to run the script 100 times and store the difference between the means in a growing vector? Any help is appreciated.
Here is a basic idea of the script.
source('Functions.R')
bunch of numbers generated and tests
difference.means=mean.t-mean.c
mat.means=matrix(data=difference.means, nrow=1, ncol=100) 

A:

replicate can run a function a number of times set by the user.
df1 <- data.frame(matrix(1:100, 10))
colMeans(sample(df1))
  X9   X6   X1  X10   X2   X3   X7   X5   X4   X8 
85.5 55.5  5.5 95.5 15.5 25.5 65.5 45.5 35.5 75.5 

replicate(5, colMeans(sample(df1)))
    [,1] [,2] [,3] [,4] [,5]
X6  55.5 35.5 75.5 85.5 85.5
X10 95.5 65.5 65.5 45.5 75.5
X8  75.5 95.5 25.5 35.5  5.5
X7  65.5 75.5 35.5 25.5 65.5
X3  25.5 25.5 15.5 55.5 35.5
X5  45.5  5.5  5.5 65.5 95.5
X4  35.5 15.5 45.5 75.5 15.5
X1   5.5 45.5 55.5 15.5 25.5
X9  85.5 55.5 95.5  5.5 55.5
X2  15.5 85.5 85.5 95.5 45.5

Therefore, in the general case:
replicate(<ntimes>, <func>)
[1]<func> (1) output
[2]<func> (2) output
...

