within_rows(dataframe, cols = 1:ncol(dataframe), replace = FALSE, FUN = base::sample)
within_columns(dataframe, cols = 1:ncol(dataframe), stratum = rep(1, nrow(dataframe)), replace = FALSE, FUN = base::sample)
normal_rand(dataframe, cols = 1:ncol(dataframe), stratum = rep(1, nrow(dataframe)), replace = FALSE, FUN = base::sample)
rows_as_units(dataframe, stratum = rep(1, nrow(dataframe)), replace = FALSE, length.out = NULL)
columns_as_units(dataframe, cols = 1:ncol(dataframe), replace = FALSE, length.out = NULL)replace must also be specified.dataframe with values randomized accordingly.
normal_rand corresponds to the 'normal shuffle' and 'normal resample' option.
For shuffling (replace=FALSE) the data is permuted over all cells of dataframe.
For resampling (replace=TRUE) data from any cell can be sampled and attributed to any other cell.
within_rows and within_columns correspond to the options with the same names.
The randomization is done within each row or column of dataframe.
So for shuffling the values of each row/column are permuted independently and for
resampling the values are sampled independently from each row/column and attributed only
to cells of the row/column they were sampled.
rows_as_units and columns_as_units also correspond to the options with the same names.
Each row or column dataframe is shuffled or resampled as whole.
Only the placement of rows and columns in the dataframe change. The values and their position within each row/column remains the same.
cols are then
bound to the resulting dataframe. The order and names of the rows and columns are preserved, except if length.out
is specified. In this case, the randomized rows/columns may be shifted to the end of the table. When both stratum and length.out are used, the function will try to keep the proportion of each strata close to the original.