ggplot() +
geom_boxplot(alpha = 0.5,
outlier.shape = NA,
coef = 0)
geom_jitter(position = position_jitter(seed = 2019, width = 0.3, height = 0.05), alpha = 0.3)
ylim(c(0, 1)) +
scale_x_discrete(guide = guide_axis(n.dodge=2))
ggtitle('Latent Profiles of Engagement', 'source: NDA') +
theme_minimal() +
scale_color_brewer(palette = 'Set2') +
xlab('') +
theme(legend.position = c(0.9, 0.8), axis.title = element_text(size = 16), axis.text.x = element_text(family = 'Roboto Mono', size = 12), axis.text.y = element_text(family = 'Roboto Mono', size = 12), legend.text = element_text(family = 'Roboto Mono', size = 10, color = 'grey42'), legend.title = element_text(family = 'Roboto Mono', size = 12, color = 'grey52'), panel.grid = element_blank(), # legend.key = element_rect(color = NA, fill = NA) legend.key = element_rect(colour = 'transparent', fill = 'transparent') )+
geom_point( data = data.frame( measures = c('Correct answers', 'Days in a row'), poms = c(1 ,1), Class = c('Disengaged learners' ,'Active learners') ) , alpha = 0.3 )
annotate( 'text', x = 1.5, y = 0.85, family = 'Poppins', size = 3, color = 'gray20', label = 'Maximum: 4090 attempts' )+ annotate( 'text', x = 5, y = 0.05, family = 'Poppins', size = 3, color = 'gray20', label = '2 days before the exam' )+ annotate( 'text', x = 6, y = 0.7, family = 'Poppins', size = 3, color = 'gray20', label = '13% of attempts in gamified modes' )
geom_curve( data = data.frame( x1 = c(1.5, 5, 6), y1 = c(0.9, 0.1 ,0.75), x2 = c(0.9, 4.4 ,5.2), y2 = c(0.975, 0.171, 0.867) ), aes( x = x1, y = y1, xend = x2, yend = y2 ), arrow = arrow(length = unit(0.07, 'inch')), size = 0.4, color = 'gray20', curvature = 0.4 )