# take a random sample (n=10) of a variable, with replacement,
# and calculate the standard deviation of the 10 numbers, 3 times
do(3) * sd(resample(Fingers$Thumb, 10))
Example output (although actual values may vary due to random sampling variation):
Example 2:
# get the means of 10,000 random samples (n=157) with replacement
# and save in a new data frame
# use head() to view the first 6 rows
new_data <- do(10000) * mean(resample(Fingers$Thumb, 157))
head(new_data)
Example output (although actual values may vary due to random sampling variation):