When I build, load and run my own package, it is only using shinyBS functionalities if i beforehand load shinyBS with 'library(shinyBS)' otherwise tooltips are not working.. and although the shiny app works (whithout shinyBS features) there are webpage errors that can be seen through the browser console.. (about some missing files..shinyBS.css and shinyBS.js)
So the questions is: How can i generate, deploy and run my own shiny package without forcing the user to load shinyBS beforehand (doing 'library(shinyBS)' ) ?!
Thank you!
The usual way of adding dependencies to an R package is to add the packages in the
ImportsField of theDESCRIPTIONfile. Here is an adaped version from Hadley Wickam's introduction.Then you will need to specify which functions from the
shinyBSpackage are actually needed in the package withimportsFromin theNAMESPACEfile. Alternatively, you can also import allshinyBSfunctions withHowever, in the case of
shinyBS, you will actually need to put the dependency in theDependsfield because of the way theonLoad/onAttachhooks are defined for that package. For more dertails, see here. YourDESCRIPTIONfile should therefore look like the following exampleThis is quite unusual and in my opinion, this issue should be fixed from the
shinyBSdevelopers. However, in the mean time using theDependsfield to make sureshinyBSis attached is a viable workaround for the issue you described.