Skip to content
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

Color aes across grouping vars #977

Open
rjazwiec opened this issue Dec 13, 2024 · 1 comment
Open

Color aes across grouping vars #977

rjazwiec opened this issue Dec 13, 2024 · 1 comment

Comments

@rjazwiec
Copy link

rjazwiec commented Dec 13, 2024

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?

@rjazwiec
Copy link
Author

Ok. I've tried to generate separate plots - but it also doesn't work. Drops all unused columns...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant