search for: funcc

Displaying 1 result from an estimated 1 matches for "funcc".

Did you mean: func
2014 Sep 28
1
Using requireNamespace() instead of require()
...se circumstances do arise: if (require("pkgB", quietly=TRUE)) { pkgB::funcB(...) } else { stop("Please install package 'pkgB' to do this.") } I understand that using requireNamespace() would be preferable and I would also prefer to do that. But funcB() depends on funcC() from pkgC that it lists under 'Depends'. So, with require("pkgB"), both namespaces (of pkgB and pkgC) are loaded and attached to the search list and things run. But with requireNamespace("pkgB"), only the namespace of pkgB is loaded, so funcC() can't be found. So,...