briatte / ggnet

Network visualization with ggplot2
https://briatte.github.io/ggnet/
194 stars 33 forks source link

Fixed a problem handling 'arrow()' and 'unit()' functions needed for … #12

Closed schmidtchristoph closed 8 years ago

schmidtchristoph commented 8 years ago

…plotting, which closes #11. In particular, the grid package was added to require_pkgs and adding grid:: prefix to arrow() and unit() calls (to eliminate devtools::check() note 'no visible global function definition') in 'ggnet()' and 'ggnet2()'. Re-organization of tests so that they now would not fail to reproduce the error in issue #11 (if it had not been fixed). Checking the package with devtools::check() now results in Status: OK (no error, warning or note).

schmidtchristoph commented 8 years ago

Dear François,

this is my proposed pull request. Maybe it is useful for you.

Best regards, Christoph

schmidtchristoph commented 8 years ago

Maybe it would be a good idea to follow Hadley Wickham's advice (in his book on writing R packages) to include all package dependencies in the Imports field in the description file and use the prefix package::function notation in the code. This makes the code easier to read and one does not need the require() / require_pkgs() functions (which were used explicitly in the tests and prevented them from failing).

briatte commented 8 years ago

I'll keep this archived in case we need it, but the forthcoming release of ggplot2 1.1.0 should solve the matter (I've been using it for several weeks, it should be out soon).

schmidtchristoph commented 8 years ago

Thanks for the information and good to know. I made these changes to ggnet to use it for a package I'm developing at work. With the development version of ggplot2 - is ggnet working without the require() calls? Keep up the good work!

briatte commented 8 years ago

All tests run fine with the dev version of ggplot2, so I suspect that yes, all problems will be solved by using that version.