Closed idavydov closed 3 months ago
This is by design: only the attached name is changed, not the name imported from the module. This is analogous to how e.g. Python or JavaScript handle aliases.
In principle it would be possible to allow renaming the exports inside the module, but since this would be changing the import’s API I’m not sure there’s a strong enough reason to implement it, even though I personally viscerally hate e.g. “fauxspaces” (stringr::str_*
, or forcats::fct_*
), and I am dreaming of having a way of eradicating them when importing such packages using ‘box’.
Thanks, @klmr .
Not sure I would personally use renaming capabilities. But if implemented, I would imagine something like this:
box::use(hm = ComplexHeatmap[.rename = c("heatmap" = "Heatmap")])
where .rename
could also receive a function:
box::use(stringr[.rename = \(x) grep("^str_", "", x)])
Error description
Created on 2024-03-06 with reprex v2.1.0
R version
‘box’ version
1.2.0