Skip to content

Commit

Permalink
Add forcats, correct sem_ci usage in the p7 plot
Browse files Browse the repository at this point in the history
  • Loading branch information
mdozmorov committed Jan 17, 2022
1 parent 93d38be commit 6d3860c
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion tutorial_R/raincloud_tutorial_r.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ First, we'll run the included "R_rainclouds" script, which will set-up the split
library(cowplot)
library(dplyr)
library(readr)
library(forcats)
source("R_rainclouds.R")
source("summarySE.R")
Expand Down Expand Up @@ -183,7 +184,7 @@ p7 <- ggplot(simdat,aes(x=group,y=score, fill = group, colour = group))+
geom_flat_violin(position = position_nudge(x = .25, y = 0),adjust =2)+
geom_point(position = position_jitter(width = .15), size = .25)+
geom_point(data = summary_simdat, aes(x = group, y = score_mean), position = position_nudge(.25), colour = "BLACK")+
geom_errorbar(data = summary_simdat, aes(x = group, y = score_mean, ymin = score_mean-ci, ymax = score_mean+ci), position = position_nudge(.25), colour = "BLACK", width = 0.1, size = 0.8)+
geom_errorbar(data = summary_simdat, aes(x = group, y = score_mean, ymin = score_mean-sem_ci, ymax = score_mean+sem_ci), position = position_nudge(.25), colour = "BLACK", width = 0.1, size = 0.8)+
ylab('Score')+xlab('Group')+coord_flip()+theme_cowplot()+guides(fill = FALSE, colour = FALSE) +
scale_colour_brewer(palette = "Dark2")+
scale_fill_brewer(palette = "Dark2")+
Expand Down

0 comments on commit 6d3860c

Please sign in to comment.