I'm not sure if modelr::permute was designed to do so (and if not, would be curious if you know similar functions), but I was hoping to generate the dataframe-equivalents of the 'perm' column; I'm hoping to compile these permuted dataframes into a single dataframe, as opposed to performing statistics on each permutation. I had considered running a loop of the 'sample' function, but that in theory could lead to duplicate outputs.
Thanks!
# an example of the current output—I'm hoping to extract the values from the 'perm' column one way or another
mtcars %>%
mutate(am = factor(am)) %>% # factor am
modelr::permute(8, am) # permute the am column `8` times
# A tibble: 8 x 2
# perm .id
# <list> <chr>
# 1 <S3: permutation> 1
# 2 <S3: permutation> 2
# 3 <S3: permutation> 3
# 4 <S3: permutation> 4
# 5 <S3: permutation> 5
# 6 <S3: permutation> 6
# 7 <S3: permutation> 7
# 8 <S3: permutation> 8