ggdotchart not grouping my values properly

Dear colleagues,
I am trying to use ggpubr() in particular ggdotchart() to make a nice plot, as an alternative to traditional bar-plots. Here is the link to my data,
https://www.dropbox.com/s/tklmaux3k03pwky/percent.csv?dl=0

The goal is to do. facetting on the field, Primary.Type, and do the grouping on the variable daytime. Here is my attempt at this;

ggdotchart(data,x="weekday",y="crime_percent",
           group="daytime",
           fill="daytime",
           facet.by = c("Primary.Type")
           
           #add="segments",
           #position = position_dodge(0.3)
           )
  

But the dots are not getting shaded as per the daytime. Here is the plot I am getting,

As seen, the dots are not getting colored with different colors.Can I kindly get help to get this idea implemented properly? thanks in advance.

Use color instead of group

library(ggpubr)
data <- read.csv("percent.csv")
ggdotchart(data,x="weekday",y="crime_percent",
           color="daytime",
           fill="daytime",
           facet.by = c("Primary.Type")
)

2 Likes

Thanks for your feedback. It works for me.appreciated.

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.