How to repeat a block of code to sample 2 values in r?
问题 (I'm new to this so now editing my question as a reproducible example). I've reviewed bootstrapping,loop and replicate functions and can't figure out how to repeat a series of steps (not just a single function) in R and store the result in dataframe. I need to randomly select 2 values from a pool of 22 values, 9 times. Then conduct a spearman rank correlation test on that dataset (2 columns, 9 rows) 10,000 times and store the value of each of those iterations. So I need to repeat these steps