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
create_table() now attempts to order the input appropriately when coercing to factor. This seems to be working-ish, but there's a new issue of implicitly missing values in things like time. Type-stability of the output is starting to seem like more of a bug than a feature. To summarize:
Factors are currently always returned by create_table(). This allows us to nicely control plotting order in the plot_* functions.
Some information is lost when coercing to factors. This can be mitigating in principle but requires significant work to re-implement existing defaults (i.e. date plotting in ggplot2)
We want to maintain sensible plotting for factor-type data, but also use the defaults for non-factor-type data
The text was updated successfully, but these errors were encountered:
Given that the issue is a plotting problem, this should really be a discussion on the plot_* family, which means I've probably implemented type coercion in the wrong function (the plot_* family should probably do it, rather that the create_* family).
The primary advantage of factors in plotting is that we can control ordering with levels. This makes sense for reordering categories based on frequency; less sense for others.
Potential fix
Move factor coercion to the plot_* family as a helper function. Add an infreq argument to that family and only use the helper when infreq = TRUE.
Actually, adding infreq will only be a switch to call the helper (or not). Since we're composing with pipes, it may be clearer to create a separate function that transforms the output of create_table() to a factor. This can then be passed to the plot_* family as usual. Benefits from chunking the conversion behavior separately from the plotting behavior.
create_table()
now attempts to order the input appropriately when coercing to factor. This seems to be working-ish, but there's a new issue of implicitly missing values in things like time. Type-stability of the output is starting to seem like more of a bug than a feature. To summarize:Factors are currently always returned by
create_table()
. This allows us to nicely control plotting order in theplot_*
functions.Some information is lost when coercing to factors. This can be mitigating in principle but requires significant work to re-implement existing defaults (i.e. date plotting in ggplot2)
We want to maintain sensible plotting for factor-type data, but also use the defaults for non-factor-type data
The text was updated successfully, but these errors were encountered: