View source: R/show_top_combos.R
show_top_combos | R Documentation |
This function takes the output of turf()
and filters the results to just
the top n
combinations according to the metric
provided. Finally, the
results are unnested into a single data frame.
show_top_combos(x, n = 5, metric = "reach")
x |
A |
n |
Number of combinations to show, default is |
metric |
Metric to sort on, one of |
A tibble
.
x <- turf(
FoodSample,
items = 2:4,
k = 1:3,
item_weights = c(Bisque = 7.49, Chicken = 10.99, Tofu = 11.99)
)
show_top_combos(x, n = 2, metric = "reach")
show_top_combos(x, n = 2, metric = "freq")
show_top_combos(x, n = 2, metric = "weight")
show_top_combos(x, n = 2, metric = "value")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.