You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I would like to write a custom extract() function for a custom class and keep that extract.custom in an other package. Do you have guidelines on how to do this (instead of sending PR to texreg), similar to how one would do with a custom tidy function (Create your own broom tidier methods)?
It seems this could create some issues, as discussed for tidy?
Please do not define tidy(), glance(), or augment() generics in your package. This will result in namespace conflicts whenever your package is used along other packages that also export tidying methods
Hence the question: do you have advice (or examples) on recommended way to add a custom extract, without sending it to texreg?
Thanks!
The text was updated successfully, but these errors were encountered:
MatthieuStigler
changed the title
Guidelinws on how to use custom extract() in distinct package?
Guidelines on how to use custom extract() in distinct package?
Oct 7, 2024
I'm not sure what the official guidance on this is. I've actually been wondering, too. If you (or anyone else) has ideas or comes across any guidance, please post here. My best guess would be something like this:
Import the generic function in your other package: importFrom("texreg", "extract")
Implement your method: setMethod("extract", "your_class_name", function(model) { ... })
Either put texreg under Imports: in the DESCRIPTION file, or put it under Suggests: and add conditional checks in the code to ensure an error message is printed if texreg is not installed or some other fallback exists. I have some of those in the texreg code as well.
Ideally, add useful documentation and testthat unit tests, but up to you.
Hi
I would like to write a custom
extract()
function for acustom
class and keep thatextract.custom
in an other package. Do you have guidelines on how to do this (instead of sending PR to texreg), similar to how one would do with a customtidy
function (Create your own broom tidier methods)?I see for example that package
panelvar
uses:and then in NAMESPACE:
It seems this could create some issues, as discussed for tidy?
Hence the question: do you have advice (or examples) on recommended way to add a custom extract, without sending it to
texreg
?Thanks!
The text was updated successfully, but these errors were encountered: