Advertisement
Guest User

Untitled

a guest
Sep 13th, 2018
103
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
R 1.10 KB | None | 0 0
  1. library(tidyverse)
  2. library(ggbeeswarm)
  3. fback <- c("Feedback","No Feedback")
  4. symb <- c("Symbolic","Non Symbolic")
  5. acc <- seq(0.3,0.9,0.05)
  6. df <- tibble(acc=acc[sample(1:13,200,prob = c(0.02,0.04,0.06,0.08,0.08,0.12,0.2,
  7.                                               0.12,0.08,0.08,0.06,0.04,0.02),replace=T)],
  8.              fback=fback[sample(1:2,200,replace = T)],
  9.              symb=symb[sample(1:2,200,replace = T)],
  10.              both=str_c(fback," ",symb),
  11.              bin=sample(0:1,200,replace = T,prob = c(0.8,0.2)))
  12. df$both <- factor(df$both,levels=c("Feedback Symbolic","No Feedback Symbolic",
  13.                                    "Feedback Non Symbolic","No Feedback Non Symbolic"))
  14.  
  15. ggplot(df)+
  16.   geom_quasirandom(aes(x=both,y=acc,fill=both),pch=21)+
  17.   geom_quasirandom(aes(x=both,y=acc,col=factor(bin),alpha=bin))+
  18.   scale_color_manual(values = c("white","yellow"),guide=F)+
  19.   scale_alpha_continuous(guide=F)+
  20.   scale_fill_manual(values=c("#CD2626", "#EE2C2C", "#104E8B","#1C86EE"),name="")+
  21.   theme_bw()+
  22.   theme(legend.position = "top",axis.text.x = element_blank())+
  23.   labs(y="Accuracy",x="")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement