I'm developing a package. How can I specify a dependent package to be installed with an option?
For example, inside description file:
Depends: cgdsr, xlsx, gplots, RColorBrewer, rafalib, Biobase, genefilter, xlsxjars
I manually install the "xlsxjars" package as "install.packages("xlsxjars", INSTALL_opts = "--no-multiarch")". How can I make it be automatically installed this way but as a dependency for another package?
Hi,
My package requires "xlsx" package to export data as excel files. Even with java runtime environment installed, R returns an error during the installation of "xlsx" package. I googled it and found "install.packages("xlsxjars", INSTALL_opts = "--no-multiarch")" in a forum. It fixed the problem for me. In Linux, specific package rjava should be installed. Otherwise, installation of "xlsx" will end with an error.
So, there is nothing I can do?
The xlsxjars Windows and Mac binaries provided on CRAN should work. If they don't, then that's probably something that you'd want to discuss with the xlsxjars maintainers and/or the CRAN folks. It's good that you found a workaround that fixes the problem for you but that doesn't really address the issue. You can't control how depending packages get installed. How could you? Depending packages could already be installed on the user machine before the user tries to install your package. So all you can and should do is assume that depending packages are already installed and working properly on the user's machine. How they got installed is not your business as far as development of your own package is concerned.
Hope that makes sense,
H.