hughjonesd / huxtable

An R package to create styled tables in multiple output formats, with a friendly, modern interface.
http://hughjonesd.github.io/huxtable
Other
321 stars 28 forks source link

An interface to extract model name in `huxreg` #109

Closed mattfidler closed 5 years ago

mattfidler commented 5 years ago

Describe what is missing

When you use huxreg with models, like nlmixr models, it uses the column names (1), (2) etc. For the nlmixr modeling package a model name can be included in meta-information, so these could be extracted from the model.

Describe your proposed solution Provide a s3 method for extracting model information when it is missing.

Target audience At least the nlmixr modeling community, though others may benefit as well.

Additional context If you are interested, I can provide a pull request

hughjonesd commented 5 years ago

If it will only work with nlmixr models, then that may be too specific for me to include. I’d be interested if there were a generic/widely-used interface, though. -- Sent from Gmail Mobile

mattfidler commented 5 years ago

It would be an s3 method, so it could be used elsewhere. For example in my community xpose interfaces with NONMEM and also retains model fit name information.

I would be even happy with

huxreg(fit1, fit2)

To show the column names fit1 and fit2 instead of 1 and 2...

This is very easy to achieve if you wish me to add it

hughjonesd commented 5 years ago

I can see the advantages of that as an S3 method, but I think it is out of scope for huxtable. It might be worth talking to the modelgenerics/broom people.

(it's important to keep the current fixed on a single mission, otherwise you end up with a sprawling mess. I even worry that huxreg itself involves a bit of mission creep….)

In general, you can do:

huxreg(name1 = fit1, name2 = fit2,...)

which achieves roughly the same as the second example.

mattfidler commented 5 years ago

I understand. Thank you.