Skip to content

Commit 251136f

Browse files
committed
Fixed occasional used_here warning
1 parent 8f8b9af commit 251136f

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

NEWS.md

+2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,7 @@
11
# usedthese (development version)
22

3+
* Fixed occasional `used_here()` warning
4+
35
# usedthese 0.3.2
46

57
* `used_there()` fails gracefully if Internet resource unavailable

R/used_here.R

+3-4
Original file line numberDiff line numberDiff line change
@@ -65,14 +65,13 @@ used_here <- \(fil = knitr::current_input()) {
6565
dplyr::distinct()
6666

6767
funs_scouted <- conflicted::conflict_scout() |>
68-
purrr::transpose() |>
69-
purrr::list_flatten() |>
70-
purrr::discard(is.null) |>
71-
tibble::as_tibble(.name_repair = "minimal")
68+
unlist() |>
69+
dplyr::bind_rows()
7270

7371
if (nrow(funs_scouted) > 0) {
7472
funs_scouted <- funs_scouted |>
7573
tidyr::pivot_longer(tidyselect::everything(), names_to = "func") |>
74+
dplyr::mutate(func = stringr::str_remove(func, "\\d$")) |>
7675
dplyr::summarise(pckg_preferred = stringr::str_flatten_comma(value, na.rm = TRUE), .by = func)
7776
} else {
7877
funs_scouted <- tibble::tibble(pckg_preferred = "zzz", func = "zzz")

0 commit comments

Comments
 (0)