webchem
webchem copied to clipboard
Importing functions from other packages
I've recently read an interesting article about connecting to other packages: https://kbroman.org/pkg_primer/pages/depends.html
I do revisit functions quite often to see if @importFrom
or @import
were added, and to me this approach seems a bit error prone. I think it would be much better to use package::function()
syntax everywhere in the package and remove all instances of @import
and @importFrom
. What do you think?
I thought @import
tags were necessary for the NAMESPACE file to be built correctly? I'll have to read some more about it.
So I read the post, and I get it, but I'm not sure this is a big enough deal to go through the entire codebase and remove all the @import tags.
I also think it's more clear to use the ::
operator. I sometimes find myself not knowing to which package a function belongs. I think this is also special for R, as for example, in Python one has to always reference to the library: numpy.array([1,2,3])
. However I agree with @Aariq whether this is a big enough deal to go through the whole codebase. Then again, it would be consistent.
Agree, huge work, little gain. Maybe what we can do is to keep an eye out for these when we do other stuff, and over time the functions will be naturally updated? Similarly to lintr::lint()
where we don't fix the style for the package in one go but improve the style over time? Then the outcome of this issue for now would be to add a bullet to CONTRIBUTING.md.
https://github.com/dreamRs/prefixer