Rsampling: Repeats randomizations and scores summary statistics

Description Usage Arguments Value Details References


Repeats resampling/shuffling of dataframes and scores the values returned by user-define function which is applied to each randomized dataframe.


Rsampling(type = c("normal_rand", "rows_as_units", "columns_as_units",
  "within_rows", "within_columns"), dataframe, statistics, ntrials = 10000,
  simplify = TRUE, progress = "text", fix.zeroes = FALSE, ...)



character; the name of the randomization function to be applied to dataframe. See randomization functions.


a dataframe with the data to be shuffled or resampled.


a function that calculates the statistics of interest from the dataframe. The first argument should be the dataframe with the data and preferably should return a (named) vector, data frame, matrix or array.


integer; number of randomizations to perform.


logical; should the result be simplified to a vector, matrix or higher dimensional array if possible?


which kind of progress bar should be used (currently unimplemented!)


logical; for normal_rand, within_rows or within_columns, should zeroes in the dataframe be kept in place? See the help on zfsample for more details.


further arguments to be passed to the randomization functions (e.g., cols, replace, stratum).


a list of objects returned by the function defined by statistics or a vector, matrix or array when simplify=TRUE and simplification can be done (see simplify2array).


This function corresponds to Repeat and score in Resampling Stats add-in for Excel ( The randomization function defined by type is applied ntrials times on the data provided by dataframe. At each trial the function defined by argument statistics is applied to the resulting dataframe and the resulting objects are returned.

References LCC. 2009. Resampling Stats Add-in for Excel User's Guide.

Search within the Rsampling package
Search all R packages, documentation and source code

Questions? Problems? Suggestions? or email at

Please suggest features or report bugs with the GitHub issue tracker.

All documentation is copyright its authors; we didn't write any of that.