I try not to use other packages for a few reasons:
- I think a good grasp of what is available within base R helps me get the most out of R
- The more packages I use, the more the risk of incompatibilities, especially when dealing with specialized data structures
- There's just something ugly about an R-script that requires as many packages as it has lines.
- Packages come and go. There are packages that are stable but not maintained, and others that are today's hot stuff, and then there are those that are very specialized. Building a new package into my workflow is therefore a bit of a risk.
So, I usually try to answer R questions using base-R functions as much as possible. But, when is it acceptable to use a new or different package?
- If the new package offers the capability to both 1) replace bits or all of the orginal code and 2) answer the question
- If the OP is using old / deprecated packages
- If the question talks about a further workflow where there are specific needs that the new package might help with.
So, let's say there's a package that looks helpful. So, how should you provide a code solution? Personally I would submit an answer that includes:
- A solution using the original packages as far as possible (or refers to another answer in base R or the original packages)
- An example using a specific package, complete with the
require(blah)
and any information about the repository if it's not on CRAN. - A little bit of background about why the new package is better than the current choice
Ultimately theThe choice of package is very personal and the OP and community can choose the answer with the package that best fits their workflowworkflow; the up- or down votes that you get will tell you the result. AnAt the end of the day an answer that suggests a new package may turn out to be very useful, or not. It's a little bit the luck of the draw. Good luck!