data = read.csv(file= "~/Downloads/data.csv")
temp=(data$temp)
n=75
N=length(temp)
s=sample(1:N, n)
ybar=mean(temp[s])
I want to run the sample 100 times where n is 75. Then calculate average of each sample, and subtract each average from a set number (50).
Maybe a short loop is the way to go. Notice the bracket on the left-side of the equals sign in the last line of code - it's the key to using a loop for your calculation!