Choose similar object more often, depending on `similarity_factor`.

similarity_sample(sim_mat, size, similarity_factor = 1)

Arguments

sim_mat

Similarity matrix with samples as row/col names.

size

How many samples to draw.

similarity_factor

Uniform sampling for 0. Weights mixture of uniform and similarity vector for each draw.

Value

Vector of samples.

Examples

similarity_sample(matrix(runif(100), nrow = 10, ncol = 10), 3)
#> [1] 4 6 1