tbone tbone - 27 days ago 8
R Question

Plot "Dotplot" (stacked points)

I know there is a

dotchart
function in R for making a dotplot but it doesn't give me quite what I am looking for. I want the plot style to resemble something closer to the following:

c(8, 12, 10, 16, 6, 25, 21, 15,17, 5, 26, 21, 29, 8, 10, 21, 10, 17, 15, 13)


enter image description here

Is there anything in R that can do this?

Answer Source

There's literally ggplot2 geom called "dotplot" :-)

df <- data.frame(a = c(8, 12, 10, 16, 6, 25, 21, 15, 
                       17, 5, 26, 21, 29, 8, 10, 21, 
                       10, 17, 15, 13))

library(ggplot2)
ggplot(df, aes(a)) + 
    geom_dotplot()

enter image description here