shuffle: Random shuffle of integers and associated decimals

View source: R/shuffle.R

shuffleR Documentation

Random shuffle of integers and associated decimals

Description

The 'shuffle()' function takes a numeric column in a data frame and randomly "shuffles" the integers and decimals by separate the integers from the associated decimals and sampling the decimals without replacement. The 'average_fre()' function is then used to calculate the average frequency for the shuffled data.

Usage

shuffle(data, variable, group = NULL, decimal_place = 1, reps = 1)

Arguments

data

A data frame

variable

A numeric variable that includes the first decimal place.

group

A second variable used to group the primary variable such that average frequency is calculated separately for each group.

decimal_place

The number of decimal places used for the calculation. The default is set to "1" meaning decimals in the second (hundreds place) and below are discarded.

reps

The number of shuffles (simulations) to perform. The default is set to 100.

Value

A tibble

Examples

shuffle(simulated_normal, obs)


josh-mc/fabricated documentation built on April 25, 2022, 1:31 p.m.