I am pretty new to package development, and I am currently struggling with a rather silly issue. My package ("ggseqplot") has one dependency ("TraMineR") which displays its startup message (created with packageStartupMessage) every time my package is loaded. I have my own startup message, however, which also acknowledges the dependency and I want to get rid of the startup message of the dependency.
I assume that this has to happen within the .onAttachcall in "zzz.R". I tried a bunch of different solutions suggested on StackExchange, but I didn't succeed in getting rid of the dependency's startup message. I am very much looking forward to your suggestions for solving my little newbie problem.
use Suggests instead of Depends AND loading the TraMineR package in .onLoad(). You would also need some safeguards in tests as CRAN sometimes run tests without installing Suggested packages. By safeguards I mean something like a custom skipper that'd skip tests based on whether TraMineR is installed, see Skipping tests • testthat
Maybe someone else here will have other ideas though!
I started wondering whether TraMineR code could be amended to make the message conditional based on where it is attached from but I can't think of a solution.
Thanks for your response and the helpful link to the citation blog post. I added TraMineR as a dependency because my package is "designed to be used in conjunction with [this] package" which according to Wickham & Bryan seems to be the only legit case for a dependency. As all of my examples in the documentation and all tests are using example data from TraMineR and also call functions from TraMineR it seemed reasonable to reflect this very close "conjunction" by making it a dependency. Nevertheless, I will think about reverting to an Import.
I am really surprised that it is not as easy as I expected to get rid of the starting message. Maybe, that's due to the fact that starting messages are not commonly used and that dependencies are rarely used these days.
Note that if you revert to Suggests, and load the TraMineR package in your package's .onLoad(), you more or less mimick the behavior of Depends (minus the startup message, plus the need of safeguards in tests).