STHDA forum

ggpubr » Problem displaying jitter with color based on label Problem displaying jitter with color based on label

Slingshot booster

rank_0.png

Avatar

Signed up since: 25/03/2019

Messages: 3

On 03/25/2019 at 16h31
Hi Kassambara,

I would like to plot the values of data in boxplots based on label_1 categories, to display the mean, to display p-values of comparison between means, and to display a jitter of the datapoints displayed in different colors by label_2 categories.

My data looks like this:

value label_1 label_2
1 A D
2 B E
5 A F
7 C D
1 C F

With geom_boxplot I manage to do part of what I want using:
ggplot(data, aes(x = label_1, y = value, fill = label_1)) + geom_boxplot() + geom_point(mapping = aes(color = label_2))

However, it doesn't look quit as nice as your plots and it doesn't allow to immediately include p-values of comparisons of means.

When I use:

ggboxplot(data, x = "label_1", y = "value", color = "label_1", palette = "jco", add = c("jitter","mean"), add.params = list(color = "label_2", size = 0.5)

This doesn't seem to work at all.

Could you help me with this?

Thanks,

Waas
   
Answer
You aren't allowed to write in this category
1 User online : 0 Administrator, 0 Moderator, 0 Member and 1 Visitor
User online : No member online