Skip to content

Color aes across grouping vars #977

@rjazwiec

Description

@rjazwiec

It is a general idea.

I have dataset from clinical study. Data for two dosing regimens, on two different days. Several parameters from PK analysis to compare.
Trought whole report I want to keep consistent color meaning - orange for lower dose black for higher dose.
I use ggstatsplot::grouped_ggbetweenstats

It is easy to pass color aes when comparing by parameter you want to color:

grouping.var = day_l
color = dose_l

Gives great result (sorry for the rough blinding - restricted data and I don't want to generate dummy plots)

cmax_r_dose_l_by_day_l

But if I want to test by day but still have consistent color aesthetics (both box in the left pane orange, both in the right black):

grouping.var = dose_l
color = dose_l

It generates error because at the moment of setting colors grouping variable is already dropped.

It left me with:

cmax_r_day_l_by_dose_l

Is there any way to work around it except generating two separate plots and arranging it together?
Or can you consider modification that will leave grouping variable for both sets after filtering by it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions