SyntaxFix
Write A Post
Hire A Developer
Questions
This is another way to shuffle the data.frame using package dplyr:
data.frame
dplyr
row-wise:
df2 <- slice(df1, sample(1:n()))
or
df2 <- sample_frac(df1, 1L)
column-wise:
df2 <- select(df1, one_of(sample(names(df1))))