New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gt_plt_dist: different plot types on different rows? #102
Comments
Howdy @DanielEWeeks - thanks for the feature request. Let me ponder on this one - it's a fairly big change to the interface/internals, as we'd now need a 2nd column that represents the |
Theoretically I have this working... But I'm not sure if there's some interaction with In this case, library(dplyr)
library(gt)
library(gtExtras)
df <- tibble(
trait = c("age", "weight", "time"),
Distribution = c(list(
rnorm(1000),
sample(1:10, 1000, replace = TRUE),
runif(1000, min = 5, max = 10)
))
) |>
mutate(type2 = c("density", "histogram", "density"))
df
# This stops with an error
df %>%
gt() %>%
gt_plt_dist(
Distribution,
same_limit = TRUE,
type_col = type2,
fig_dim = c(5, 30)
) |
But it looks like your default computation of
would not be altered by changing the But, when drawing multiple histograms, it would be possible then that one might want to use different bin widths for different histograms instead of a common To support that, instead of a vector of graph types, one would instead need to accept a list (or data frame) of graph parameters, so each spark plot could have individually customized parameters if desired. I guess which parameters go in the list would depend on how much individual-specific spark plot customization would likely to be useful or desired. I would think most of these one would typically be applied in common across all the spark plots, but
Having a list or data frame of graph parameters sounds a bit hard to support, but maybe not if there's a function to populate a default parameter list based on a vector of desired types. |
…smock#104" This reverts commit a04080d.
…) - closes jthomasmock#102" This reverts commit 208fc8f.
Prework
Question
Currently
gt_plt_dist
uses the same singletype
for all rows in the table.However, our tables often have a mixture of continuous and categorical variables, so could
gt_plt_dist
be extended to accept a vectortype
with one entry for each row of the table, thereby allowing different plot types to be generated for different rows?The text was updated successfully, but these errors were encountered: