docs: roxygen, NEWS, and pkgdown for basket mode

Adds full @description, @details (algorithm), @examples on
cog_gov_search(); examples on cog_basket_resolution() /
cog_basket_unresolved(); NEWS.md entry covering the new mode and
the pattern->name rename; pkgdown reference entries for the two
new exports.
This commit is contained in:
2026-04-28 12:51:52 -04:00
parent 7475696853
commit 24e67791a0
7 changed files with 211 additions and 32 deletions
+17
View File
@@ -86,6 +86,15 @@
#' list-column (full-schema match candidates per input row). Default
#' `FALSE`.
#' @return A tibble with the resolution audit trail.
#' @examples
#' \dontrun{
#' basket <- cog_gov_search(
#' name = c("Broward", "San Diego", "Notarealplace"),
#' state = c("FL", "CA", "NY")
#' )
#' cog_basket_resolution(basket)
#' cog_basket_resolution(basket, expand_candidates = TRUE)
#' }
#' @export
cog_basket_resolution <- function(x, expand_candidates = FALSE) {
res <- attr(x, "resolution")
@@ -111,6 +120,14 @@ cog_basket_resolution <- function(x, expand_candidates = FALSE) {
#'
#' @param x A tibble returned by basket-mode [cog_gov_search()].
#' @return A tibble (subset of [cog_basket_resolution()]).
#' @examples
#' \dontrun{
#' basket <- cog_gov_search(
#' name = c("Broward", "San Diego", "Notarealplace"),
#' state = c("FL", "CA", "NY")
#' )
#' cog_basket_unresolved(basket)
#' }
#' @export
cog_basket_unresolved <- function(x) {
res <- cog_basket_resolution(x, expand_candidates = TRUE)