recommendation_table: Pretty table of recommendation scores

View source: R/fcaR_helpers.R

recommendation_tableR Documentation

Pretty table of recommendation scores

Description

Turns the named numeric vector from implications$recommend() into a sorted data frame that is easy to read in the console or in Quarto.

Usage

recommendation_table(recoms, drop_zero = TRUE, query = NULL)

Arguments

recoms

Named numeric vector (as returned by $recommend()).

drop_zero

Logical; if TRUE (default), drop attributes with score 0 (not implied / not recommended).

query

Optional character vector of attributes that were in the original query. If set, adds a role column: "query", "recommended", or "not implied".

Value

A data frame with columns attribute, score, and optionally role. Rows are ordered by decreasing score, then name.

Examples

## Not run: 
S <- attribute_set(fc, "Romantic", "Slow_burn")
recoms <- fc$implications$recommend(S, attribute_filter = fc$attributes)
recommendation_table(recoms)

## End(Not run)


fcaR documentation built on July 27, 2026, 5:06 p.m.