cynkra / dm

Working with relational data models in R
https://dm.cynkra.com
Other
501 stars 49 forks source link

Make igraph dependency optional #2146

Open mlell opened 12 months ago

mlell commented 12 months ago

I would like to investigate the dm package as a recommendation for our group as an intermediate solution to multi-table handling that can be extended to a more thorough solution. However, I have to watch out for excessive dependencies as this complicates the installation process.

The igraph package, it seems to me, is only necessary to plot the relationships between the tables. This is useful, but not a core functionality. In contrast to the dependencies on the tidyverse packages, which often are already available because of their broad application range, igraph is only needed if one wants to compute on or visualize graphs. Therefore it is an additional burden (I timed 2m50s for the compilation time of igraph on Linux). But also on Windows this time must often be spent, e.g. when re-creating previously-used sets of packages for reproducibility (e.g. using renv). The process of installing many packages is cumbersome and error-prone especially for newcomers and the compilation times add up over many packages.

Therefore, as dm also has a potentially broad applicability like dplyr, I would be happy if you could relax the dependency on igraph to "Suggested".

mlell commented 11 months ago

To back this point up with a bit of data, please find here the installation times extracted from the CRAN logs using the itdepends package:

krlmlr commented 11 months ago

Thanks, good point regarding the compilation time. Happy to review a PR that uses check_suggested() in the appropriate places. However:

mlell commented 11 months ago

Thanks for taking a look on this. Then I will dig into the code and see if I can disentangle it. As of my current knowledge, binary packages are not compatible with reproducibility solutions like the renv package, which compiles packages of a specified version, both on Windows (where otherwise binary packages are available per default) and Linux (where one need admin rights or a container compatible with the available binary PPAs)

krlmlr commented 11 months ago

Thanks. In addition to the arguments above: Chances are that igraph is used by other packages, it has over 100 packages that import igraph or depend on it.

asadow commented 9 months ago

This would also simplify using dm in Dockerized projects that have no use for the graphs (as beautiful and handy as they are).