Closed huftis closed 6 months ago
Hi,
Thank you for your suggestions! Standardization of output is on the roadmap for our next feature release, see here and issue #31 in particular. Glad to know there are users looking forward to it.
Changing the printing behavior is proposed by issue #27, but currently not on any roadmap (can't really remember why). I agree this is all part of the same topic, but keeping things separate makes work more manageable. :)
Closing this as duplicate, but keeping it linked to the aforementioned issues for the valuable examples.
On second thought, I'll reinstate and rename this so we can analyse the novel proposal of standardizing the output names (e.g. "P" vs. "p.value") and keep issue #31 only handling the output class of the functions themselves.
Hi @huftis,
contingencytables 2.0.0 has just been uploaded to CRAN with several fixes, including a standardization of the printing behavior you mentioned (see issue #31). Sorry it took this long; we went through a few iterations until we found a design that worked well enough (not to mention there were 150+ functions to refactor).
Regarding the aforementioned inconsistencies in the names of the output elements, we'll address this on a future release.
Thank you once again for your feedback.
Done. Fix available on develop
branch, coming to CRAN very soon.
It would be nice with some (or preferably, complete) consistency in the values returned by the various functions.
Here’s an example, with three similar functions, where the first one returns a data.frame, the second returns a numeric vector, and the third returns a list. And the elements of the data.frame and the list even have different names. For the data.frame, the p-value is called
p.value
, while for the list, it’s calledP
.If the functions instead returned an object with a consistent structure and element names, they would be much easier to use, e.g., in simulations.
And if the returned objects had a fixed class assigned, a
print
method could be defined for this class, so the annoyingprintresults
argument could be removed from all functions in the package. For an example of how this would work, see how thet.test()
andprop.test()
functions use thehtest
class for their output. The output is printed bystats:::print.htest()
, which is automatically called when when youprint()
the object (which is automatically done when you run the original function without assigning the result to a variable).