I am attempting to produce a horizontal dot plot of group medians for multiple variables. For the dummy data below I would like to have a "line" for each variable( x,y,z,w) with the seven group medians plotted on each line and distinguished by color. Any help appreciated Thanks!
library(dplyr)
dat=data.frame(x=runif(100,1,10),y=runif(100,1,5),z=runif(100,1,15),
w=runif(100,1,20),grp=sample(LETTERS[1:7],100,replace=T))
dat_summ=dat %>% group_by(grp)%>%
summarise_all(funs(median(., na.rm = TRUE)))
Something like this
x|_______A_____B____C_D__EF_G
y|_______C_D_E_____F__________B____A_G
z|etc.
w|etc.
|
|
|
|
|____________________________________________________________________
| | | |
5 10 15 20
