diff --git a/exp1analysis.Rmd b/exp1analysis.Rmd index 75f8465..141212e 100644 --- a/exp1analysis.Rmd +++ b/exp1analysis.Rmd @@ -12,7 +12,7 @@ library(broom) ## load data data = read_csv('./exp1.csv') - +save = FALSE ## set to TRUE if you want to output a folder with all the plots from the paper ## helper function for significance stars @@ -150,7 +150,6 @@ ss2atop = ggplot(data = fig2a, aes( x = recall_move, y = mean_err, geom_point(size = pt_size, position = pd) + scale_shape_manual(values = ss_shapes) + scale_color_manual(values = sns_colors)+ - # scale_y_continuous(breaks = seq(3,6, by = 1)) + scale_x_continuous(limits = c(0.8,4.2), breaks = c(1,2,3,4)) + scale_y_continuous(limits = c(2.5,6.5), breaks = c(3,4,5,6)) + geom_errorbar(aes(ymin = mean_err - sem, @@ -160,8 +159,9 @@ ss2atop = ggplot(data = fig2a, aes( x = recall_move, y = mean_err, y = "Error \n (Distance from target, cm) \n", x = "\n Movement recalled ") + mytheme +ss2atop -ggsave(file= '../all_plots/ss2atop.svg', plot = ss2atop) +if (save == TRUE) { ggsave(file= '../all_plots/ss2atop.svg', plot = ss2atop)} ``` ```{r Figure 2A (bottom) - cost} @@ -200,7 +200,8 @@ ss2abottom = ggplot(data = fig2acost, aes( x = recall_move, y = mean_cost, shape x = "\n Movement recalled") + mytheme -ggsave(file= '../all_plots/ss2abottom.svg', plot = ss2abottom) +ss2abottom +if (save == TRUE) { ggsave(file= '../all_plots/ss2abottom.svg', plot = ss2abottom)} ``` diff --git a/exp2analysis.Rmd b/exp2analysis.Rmd index ed72eda..6ac3aef 100644 --- a/exp2analysis.Rmd +++ b/exp2analysis.Rmd @@ -15,7 +15,7 @@ library(broom) ## load data data = read_csv('./exp2.csv') - +save = FALSE ## set to TRUE if you want to output a folder with all the plots from the paper ## helper function for significance stars @@ -132,7 +132,7 @@ fig2b = fig2b %>% fig2b$sem = fig2b$sd/sqrt(fig2b$n) ## standard error ## main plot -del2btop = ggplot(data = fig2b, aes( x = n_moves, y = mean_err, color = factor(switch_hands))) + +irr2btop = ggplot(data = fig2b, aes( x = n_moves, y = mean_err, color = factor(switch_hands))) + geom_line(size = ln_size, position = pd) + geom_point(size = pt_size, position = pd) + geom_errorbar(aes(ymin = mean_err - sem, @@ -146,11 +146,9 @@ del2btop = ggplot(data = fig2b, aes( x = n_moves, y = mean_err, color = factor(s y = "Error \n (Distance from target, cm) \n", x = "\n Number of irrelevant movements ") + mytheme +irr2btop - -ggsave(file= '../all_plots/del2btop.svg', plot = del2btop) - -del2btop +if (save == TRUE) { ggsave(file= '../all_plots/irr2btop.svg', plot = irr2btop)} ``` @@ -174,7 +172,7 @@ fig2bcost = fig2bcost %>% fig2bcost$sem = fig2bcost$sd/ sqrt(fig2bcost$n) ## main plot -del2bbottom = ggplot(data = fig2bcost, aes( x = n_moves, y = mean_cost)) + +irr2bbottom = ggplot(data = fig2bcost, aes( x = n_moves, y = mean_cost)) + geom_line(size = ln_size, position = pd, color = combo_dark) + geom_point(size = pt_size, position = pd, color = combo_dark) + geom_errorbar(aes(ymin = mean_cost - sem, @@ -203,7 +201,8 @@ fig2bcost_stars = data %>% summarize(condition = paste0("irr mvmt sw cost (sw v nosw)"), t = statistic, p = p.value, stars = sig_stars(p.value) ) print(fig2bcost_stars) -ggsave(file= '../all_plots/del2bbottom.svg', plot = del2bbottom) +irr2bbottom +if (save == TRUE) { ggsave(file= '../all_plots/irr2bbottom.svg', plot = irr2bbottom )} ``` @@ -313,10 +312,10 @@ del2ctop = ggplot(data = fig2c, aes( x = delay, y = mean_err, color = factor(swi x = "\n Short or long delay (seconds)") + mytheme -ggsave(file= '../all_plots/del2ctop.svg', plot = del2ctop) - del2ctop +if (save == TRUE) { ggsave(file= '../all_plots/del2ctop.svg', plot = del2ctop)} + ``` ```{r Figure 2C (bottom) - cost (switch - noswitch)} @@ -352,8 +351,10 @@ del2cbottom = ggplot(data = fig2ccost, aes( x = delay, y = mean_cost)) + x = "\n Delay") + mytheme -ggsave(file= '../all_plots/del2cbottom.svg', plot = del2cbottom) + del2cbottom + +if (save == TRUE) { ggsave(file= '../all_plots/del2cbottom.svg', plot = del2cbottom)} ``` ```{r Stats and Stars 2C} diff --git a/exp3analysis.Rmd b/exp3analysis.Rmd index 8f02a12..7812518 100644 --- a/exp3analysis.Rmd +++ b/exp3analysis.Rmd @@ -14,6 +14,7 @@ library(BayesFactor) ## load data data = read_csv('./exp3.csv') +save = FALSE ## set to TRUE if you want to output a folder with all the plots from the paper ## helper function for significance stars @@ -107,8 +108,8 @@ vsp3b = ggplot(data = fig3b, aes(x = factor(vsp_setsize), y = mean_prec, fill = x = "\n Number of Visual Targets") + mytheme - -ggsave(file= '../all_plots/vsp3b.svg', plot = vsp3b) +vsp3b +if (save == TRUE) { ggsave(file= '../all_plots/vsp3b.svg', plot = vsp3b) } ``` @@ -159,7 +160,7 @@ vsp3c = ggplot(data = fig3c, aes(x = vsp_setsize, y = mean_err, color = factor(s x = "\n Number of Visual Targets") + mytheme -ggsave(file= '../all_plots/vsp3c.svg', plot = vsp3c) +if (save == TRUE) {ggsave(file= '../all_plots/vsp3c.svg', plot = vsp3c)} vsp3c ``` @@ -259,12 +260,15 @@ vsp3d = ggplot(data = fig3d, aes(x = vsp_setsize, y = mean_cost)) + scale_x_continuous(limits = c(0.8,3.2), breaks = c(1,3)) + scale_y_continuous(limits = c(0.5,1.3), breaks = c(0.6, 0.8, 1.0, 1.2)) + labs( - # title = "Movement recall switch cost", + # title = "Movement recall error switch cost", y = "Switch Cost \n (Switch - No-switch, cm) \n", x = "\n Number of Visual Targets") + mytheme + vsp3d -ggsave(file= '../all_plots/vsp3d.svg', plot = vsp3d) + +if (save == TRUE) {ggsave(file= '../all_plots/vsp3d.svg', plot = vsp3d)} + ``` ```{r Stats and Stars 3D} @@ -337,7 +341,7 @@ vsp3e = ggplot(data = fig3e, aes(x = vsp_setsize, y = mean_ang_cost)) + mytheme vsp3e -ggsave(file= '../all_plots/vsp3e.svg', plot = vsp3e) +if (save == TRUE) {ggsave(file= '../all_plots/vsp3e.svg', plot = vsp3e)} ```