> v.cor <- sapply( + 1:1000, function(i) cor(v.n, tapply(sample(d$dist), d$mother, max)) +) > quantile(v.cor, prob = c(0.025, 0.975)) 2.5% 97.5% 0.38021 0.74378