The cli::tree() function throws a (presumably) undesirable warning if it's passed a tibble instead of a data frame (presumably, a likely use case). It's caused by
|
trimlabs <- data$trimmed %||% labels |
where
data$trimmed returns
NULL as expected but also a warning if
data is a tibble. There are numerous obvious, easy ways to work around that, so I won't bother suggesting a solution/PR.
data <- data.frame(
stringsAsFactors = FALSE,
package = c("A", "B", "C"),
dependencies = c("B", "C", "")
)
cli::tree(data)
#> A
#> └─B
#> └─C
cli::tree(tibble::as_tibble(data))
#> Warning: Unknown or uninitialised column: `trimmed`.
#> A
#> └─B
#> └─C
data$trimmed
#> NULL
tibble::as_tibble(data)$trimmed
#> Warning: Unknown or uninitialised column: `trimmed`.
#> NULL
The
cli::tree()function throws a (presumably) undesirable warning if it's passed a tibble instead of a data frame (presumably, a likely use case). It's caused bycli/R/tree.R
Line 117 in bc066c1
where
data$trimmedreturnsNULLas expected but also a warning ifdatais a tibble. There are numerous obvious, easy ways to work around that, so I won't bother suggesting a solution/PR.