Replace looping with apply in simple Permutation Test code

broom is really awesome to get tidy model ouput.
You should also take a look at tidymodels


And If your question's been answered, would you mind choosing a solution? It helps other people see which questions still need help, or find solutions if they have similar problems. Here’s how to do it: