tidystats
tidystats copied to clipboard
Support for data.frames
How about adding support for any sort of data.frame
(and perhaps matrix
)? This is really simple and would cover any conceivable statistics that can be put in a table format. I already have a helper function for it (df_to_group; it was needed for metafor's data.frame
outputs), so we would just need to wrap it under a tidy_stats
class.
That makes sense. Although it will be a bit tricky to figure out the symbols and potential subscripts. Although we could just omit those things.
Yes, it could be either omitted or added as optional via a parameter. (I already have a short list of replacements for "frequently occurring" symbols, see here; this could be expanded and used for this purpose.)
Good idea. It could be an optional argument that takes either a vector or a list. A vector could be provided in case the user wants to provide a symbol/subscript for all stats, or a list in case only some of the statistics should have a symbol and/or subscript.
For example: df_to_group(df, symbols = list("estimate" = "t"))
We should call the function something else though. Perhaps df_to_stats()
or tidy_df()
.
As discussed, this became part of the add_stats
function (with additional optional parameters) rather than a function on its own; see implemented here. I guess a short description of the optional parameters should be given somewhere in the documentation. Let me know if I should add it (and if yes, where).