I have a package that uses the trim() function in the gdata package. I literally use nothing else from the package and (as some of you may have seen) it overwrites some functionality of base R that I need.
Is there a way to load only one function rather than the whole package?
Sure. Just use an
importFromdirective in your NAMESPACE file (as described here in R-exts).OP EDIT: As of R 3.2.0 there’s now a base function:
trimws()