Description Usage Arguments Value
View source: R/sample_partitions_by_half.R
Generate Random, Non-Overlapping, Similarly-Weighted, Two-Set Partition of Indices
1 2 3 4 5 6 7 | sample_partitions_similar_weights_by_half(
w,
fraction,
w_tolerance = 0.01,
max_rejections = 100L,
warn = TRUE
)
|
w |
Numeric vector of |
fraction |
A numeric of length two in (0,1/2] specifying the size of
each partition relative to |
w_tolerance |
Maximum allowed difference between target weight of
each of the two sets (e.g. |
max_rejections |
The maximum number of rejections before giving up. |
warn |
If |
A list of two disjoint random non-overlapping partitions where each
element holds indices in {1, 2, ..., n}. The first element holds the
'reference' partition and the second the 'test' partition.
Attribute weights
gives the total normalized weight of each set.
If no accepted sample was found, then NA
is returned.
Attribute count
gives the number of internal samples produced before
arriving at an accepted or rejected partition.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.