View source: R/ComputePermutation.R
| permute_within_bins | R Documentation |
Permutes the values of one vector within bins defined by another vector. This function is intended for internal use only and should not be accessed by package users.
The binning vector is split into evenly spaced bins between its minimum and maximum values. Values of the target vector are then randomly permuted only within each bin. This preserves the approximate relationship between the target vector and the binning variable while breaking the original sample-wise ordering within local strata.
permute_within_bins(x, y, bin = 8)
x |
A numeric vector used to define bins. |
y |
A vector with the same length as 'x'. Values in 'y' are permuted within bins of 'x'. |
bin |
An integer specifying the number of evenly spaced bins. Default is 8. |
A vector with the same length as 'y', where values have been permuted within bins of 'x'.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.