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
Imports
Field of theDESCRIPTION
file. Here is an adaped version from Hadley Wickam's introduction.Then you will need to specify which functions from the
shinyBS
package are actually needed in the package withimportsFrom
in theNAMESPACE
file. Alternatively, you can also import allshinyBS
functions withHowever, in the case of
shinyBS
, you will actually need to put the dependency in theDepends
field because of the way theonLoad/onAttach
hooks are defined for that package. For more dertails, see here. YourDESCRIPTION
file should therefore look like the following exampleThis is quite unusual and in my opinion, this issue should be fixed from the
shinyBS
developers. However, in the mean time using theDepends
field to make sureshinyBS
is attached is a viable workaround for the issue you described.