[R-pkg-devel] Extending an S3 method, but putting the package in Suggests?

David Hugh-Jones davidhughjones at gmail.com
Tue Mar 14 03:46:35 CET 2017


Hi,

Cross-posted from SO:
http://stackoverflow.com/questions/42776058/extending-an-s3-generic-from-an-optional-package

I have a package which provides an as.FlexTable method for its objects,
extending the S3 generic from the ReporteRs package. So, my NAMESPACE file,
generated by roxygen, has lines:

importFrom(ReporteRs,as.FlexTable)
...
S3method(as.FlexTable,huxtable)
...
export(as.FlexTable)

I don't much want to put ReporteRs in Imports: in the DESCRIPTION file,
because it involves a big external dependency on Java. But, when I put it
into Suggests:, R CMD check gives me errors like "Namespace dependency not
required".

Is there anyway I can extend the generic without making a hard dependency?

Cheers,
David

	[[alternative HTML version deleted]]



More information about the R-package-devel mailing list