I don't think it is possible to avoid exporting S3 methods from a package and still have the class behave as intended. Use a regular function if name encapsulation is important to you.
On February 17, 2020 8:33:30 AM PST, [email protected] wrote: >Thanks for the pointer! Adding >"S3method(knit_print_helper_formula,name)" to the NAMESPACE seems to >have fixed it. > >For others who come across this, in roxygen2 parlance, that means >using: > >#' @method knit_print_helper_formula name >#' @export > >Even though the actual export is not desired. > >Thanks, > >Bill > >-----Original Message----- >From: Duncan Murdoch <[email protected]> > >On 17/02/2020 10:05 a.m., [email protected] wrote: > >> Does anyone know why the S3 method for name class objects is not >found >> when checking the package? > >I think you need to register knit_print_helper_formula.name as an S3 >method even if the generic is not exported. I forget whether you do >this in the NAMESPACE file or at runtime using registerS3method. > >______________________________________________ >[email protected] mailing list >https://stat.ethz.ch/mailman/listinfo/r-package-devel -- Sent from my phone. Please excuse my brevity. ______________________________________________ [email protected] mailing list https://stat.ethz.ch/mailman/listinfo/r-package-devel
