Skip to content

Commit

Permalink
..
Browse files Browse the repository at this point in the history
  • Loading branch information
hhillman231 committed Nov 2, 2023
1 parent d1871f6 commit c052948
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 21 deletions.
9 changes: 5 additions & 4 deletions exp1analysis.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand All @@ -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}
Expand Down Expand Up @@ -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)}
```

Expand Down
23 changes: 12 additions & 11 deletions exp2analysis.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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,
Expand All @@ -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)}
```

Expand All @@ -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,
Expand Down Expand Up @@ -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 )}
```

Expand Down Expand Up @@ -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)}
Expand Down Expand Up @@ -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}
Expand Down
16 changes: 10 additions & 6 deletions exp3analysis.Rmd
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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) }
```

Expand Down Expand Up @@ -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
```
Expand Down Expand Up @@ -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}
Expand Down Expand Up @@ -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)}
```

Expand Down

0 comments on commit c052948

Please sign in to comment.