harrelfe / Hmisc

Harrell Miscellaneous
Other
204 stars 81 forks source link

Test for usage of suggested packages. #143

Closed dmurdoch closed 2 years ago

dmurdoch commented 3 years ago

This PR adds tests for the presence of the suggested packages. Only a couple of the examples made use of them; those examples have been made conditional. The functions themselves generally have a call like

if (!requireNamespace("tables", quietly = TRUE))
  stop("This function requires the 'tables' package.")

early in the function call so that the problem is clear to the user.

This PR is motivated by this thread: https://stat.ethz.ch/pipermail/r-package-devel/2021q2/007101.html, where a (hopefully temporary) lack of plotly on a platform prevented Hmisc from installing there.