Thanks for the detailed feedback.
If it useful for your own development, we can speed
this transition up.
It would! And, I think, for anyone else using Zelig in a production
environment.
Perhaps the easiest solution would be to provide a patch release on CRAN
(say, version, 4.2-2) which would switch at least MASS from a Depends to an
Import usage.
I can understand why it is handy in the development version to include lots
in Depends. No worries on that. But if the current CRAN version could be
cleaner, that would be a big help for me.
This close to release, that makes sense, and I'm
happy you brought this
up.
Do you expect to promote the version 5 to CRAN soon? If so, what is the
time line? I just want to plan accordingly. If you are doing this soon,
then, of course, you don't need to bother with a 4.2-2
Thanks for making such a cool package!
Dave
PS. I claim full credit for convincing Gary to switch to R from Gauss more
than a decade ago . . .
;-)
On Tue, Nov 4, 2014 at 1:42 PM, Honaker, James <jhonaker(a)iq.harvard.edu>
wrote:
David,
Thanks for your feedback and ideas, and let me address your points.
Just to be clear to list members who are likely using Zelig4, these
points are with the development version of Zelig5.
*"12 packages listed under Depends"*
As you probably know, checking for dependency length is now a Check on
the CRAN list, so certainly we would move the Dependency list to an Import
list before the package is ready to send to CRAN, or even before we release
as Beta. If it useful for your own development, we can speed this
transition up. While still under development, however, I'm sure you can
appreciate it is sometimes useful to have fuller access to the packages
Zelig is bridging to while building those bridges, and thus attaching the
package ("Depends") can be useful during development. Perhaps we should
move to Imports for the available codebase on GitHub while using Depends
for a little while longer locally. This close to release, that makes
sense, and I'm happy you brought this up.
*"But because MASS is listed before dplyr in Depends in Zelig, there is
no way (if you have Zelig loaded) to have "select" refer to the function in
dplyr."*
If I understand your comment, the load order in R works in the opposite
direction than in your example (dplyr::select() here would instead replace
MASS::select() ). When you say "there is no way", obviously the
"::"
operator is excellent for disambiguation with any such conflict. (Here is
a Wickham post on this subject
http://r-pkgs.had.co.nz/namespace.html ).
However, more generally, if it is now useful for us to switch to Imports,
we can do this to aid those trialing the Zelig5.
*"including both plyr and dplyr in Depends"*
On the plyr/dplyr issue, there are small differences between how the
"mutate" works in these packages, and at present we are using plyr's
mutate
for one issue, while working to move everything shortly to dplyr. Again, a
hallmark of a package in development.
I'm excited there are users beginning to investigate Zelig5, even before
we think of it as released. I'm very interested to hear any other issues
or feedback you have.
Best,
James
--
James Honaker, Senior Research Scientist
//// Institute for Quantitative Social Science, Harvard University
------------------------------
*From:* zelig-bounces(a)lists.gking.harvard.edu [
zelig-bounces(a)lists.gking.harvard.edu] on behalf of David Kane [
dave.kane(a)gmail.com]
*Sent:* Tuesday, November 04, 2014 7:43 AM
*To:* zelig(a)lists.gking.harvard.edu
*Subject:* [zelig] Zelig ought to import specific functions rather than
Depend on 12 packages
The current version of the DESCRIPTION file for Zelig has 12 packages
listed under Depends. Writing R Extensions explains why this is a bad idea.
http://cran.r-project.org/doc/manuals/r-release/R-exts.html#Package-Depende…
Key passage:
"Field ‘Depends’ should nowadays be used rarely, only for packages which
are intended to be put on the search path to make their facilities
available to the end user (and not to the package itself): for example it
makes sense that a user of package *latticeExtra*
<http://CRAN.R-project.org/package=latticeExtra> would want the functions
of package *lattice* <http://CRAN.R-project.org/package=lattice> made
available.
Almost always packages mentioned in ‘Depends’ should also be imported
from in the NAMESPACE file: this ensures that any needed parts of those
packages are available when some other package imports the current package."
This is especially true for Zelig because of naming conflicts between some
of the packages in Depends. For me (and others?) the key issue involves
dplyr and MASS. Both have a function called "select." That function is
critically important to any user of dplyr. (I don't think it matters much
to users of MASS.) But because MASS is listed before dplyr in Depends in
Zelig, there is no way (if you have Zelig loaded) to have "select" refer to
the function in dplyr.
Also, including both plyr and dplyr in Depends seems very sloppy.
The solution (and current best practice in R) is to not use Depends so
much, if at all, and to only import functions from a package like MASS that
you actually need.
Thanks.