Skip to content
Snippets Groups Projects
Commit a77d74b4 authored by Vandewalle Gilles's avatar Vandewalle Gilles
Browse files

Upload New File

parent 22b1a583
No related branches found
No related tags found
No related merge requests found
### Script for elife Paper Performance - 18/04/2024
### Install Packages
install.packages("GGally")
install.packages("ggplot2")
install.packages("ggpubr")
install.packages("readxl")
install.packages("viridis")
install.packages("dplyr")
install.packages("viridis")
### Load packages
library(viridis)
library("GGally")
library("ggplot2")
library(ggpubr)
library(readxl)
library(dplyr)
library(RColorBrewer)
### Figure 3 - G,H
### Emotional Task ###
Perf_Emo <- read.csv("Hypo_5Con_Analysis_EMO.csv")
Perf_Neut <- read.csv("Hypo_5Con_Analysis_Neut.csv")
EAS <-ggplot(Perf_Emo, aes(x=RT_Mel_mean , y=Betas_Emo , color=as.factor(Light))) +
geom_point(show.legend = FALSE) +
scale_color_manual(values=c('#A9A9A9',"#FF8000" , "#9ECAE1", "#6BAED6", "#4292C6")) +
theme_classic(base_size = 14) + theme(
axis.text.x = element_text(color="black"),
axis.ticks = element_line(color = "black")
)+
xlab("Reaction times (ms)") + ylab("Emotional Betas (a.u.)") +
labs(tag = "G")+
scale_y_continuous(limits = c(-4,4))+
scale_x_continuous(limits = c(800,1600))+
geom_smooth(aes(x=RT_Mel_mean , y=Betas_Emo),
method=glm,se=FALSE, show.legend = FALSE, inherit.aes = FALSE, colour = "black")
ENS <-ggplot(Perf_Neut, aes(x=RT_Mel_mean , y=Betas_Emo , color=as.factor(Light))) +
geom_point(show.legend = FALSE) +
scale_color_manual(values=c('#A9A9A9',"#FF8000" , "#9ECAE1", "#6BAED6", "#4292C6")) +
theme_classic(base_size = 14) + theme(
axis.text.x = element_text(color="black"),
axis.ticks = element_line(color = "black")
)+
xlab("Reaction times (ms)") + ylab("Neutral Betas (a.u.)") +
labs(tag = "H")+
scale_y_continuous(limits = c(-4,4))+
scale_x_continuous(limits = c(800,1600))+
geom_smooth(aes(x=RT_Mel_mean , y=Betas_Emo),
method=glm,se=FALSE, show.legend = FALSE, inherit.aes = FALSE, colour = "grey38", linetype = "dashed")
### Figure 3 - F
RT_emo <- ggplot(Perf_Emo, aes(x=Light, y=RT_Mel_mean, fill=as.factor(Light))) +
geom_boxplot(width=20, show.legend = FALSE) +
scale_fill_manual(values=c('#D9D9D9',"#FDAE6B" , "#9ECAE1", "#6BAED6", "#4292C6"))+
theme_classic(base_size = 14) +
theme(
axis.text.x = element_text(color="black"),
axis.ticks = element_line(color = "black")
)+
xlab("mel EDI") + ylab("Reaction times (ms)") +
labs(tag = "F")
### Nback Performance ###
Perf_N2 <- read.csv("2back_PERF.csv")
Perf_N0 <- read.csv("0back_PERF.csv")
N2_3 <- ggplot(Perf_N2, aes(x=Accuracy, y=Hypo3, color=as.factor(Mel))) +
geom_point(show.legend = FALSE) +
scale_color_manual(values=c('#A9A9A9',"#FF8000" , "#9ECAE1", "#6BAED6", "#4292C6")) +
theme_classic(base_size = 14) +
theme(
axis.text.x = element_text(color="black"),
axis.ticks = element_line(color = "black")
)+
xlab("Accuracy") + ylab("2-back activity estimates (a.u.)") +
labs(tag = "B")+
scale_y_continuous(limits = c(-1,1))+
geom_smooth(aes(x=Accuracy , y=Hypo3),
method=glm,se=FALSE, show.legend = FALSE, inherit.aes = FALSE, colour = "black")
N2_1 <- ggplot(Perf_N2, aes(x=Accuracy , y=Hypo1, color=as.factor(Mel))) +
geom_point(show.legend = FALSE) +
scale_color_manual(values=c('#A9A9A9',"#FF8000" , "#9ECAE1", "#6BAED6", "#4292C6")) +
theme_classic(base_size = 14) +
theme(
axis.text.x = element_text(color="black"),
axis.ticks = element_line(color = "black")
)+
xlab("Accuracy") + ylab("2-back Betas (a.u.)") +
labs(tag = "C")+
scale_y_continuous(limits = c(-2,2))+
geom_smooth(aes(x=Accuracy , y=Hypo1),
method=glm,se=FALSE, show.legend = FALSE, inherit.aes = FALSE, colour = "grey38", linetype = "dashed")
N2_4 <- ggplot(Perf_N2, aes(x=Accuracy , y=Hypo4, color=as.factor(Mel))) +
geom_point(show.legend = FALSE) +
scale_color_manual(values=c('#A9A9A9',"#FF8000" , "#9ECAE1", "#6BAED6", "#4292C6")) +
theme_classic(base_size = 14) +
theme(
axis.text.x = element_text(color="black"),
axis.ticks = element_line(color = "black")
)+
xlab("Accuracy") + ylab("2-back Betas (a.u.)") +
labs(tag = "D")+
scale_y_continuous(limits = c(-2,2))+
geom_smooth(aes(x=Accuracy , y=Hypo4),
method=glm,se=FALSE, show.legend = FALSE, inherit.aes = FALSE, colour = "grey38", linetype = "dashed")
N0_3 <- ggplot(Perf_N0, aes(x=Accuracy, y=Hypo3, color=as.factor(Mel))) +
geom_point(show.legend = FALSE) +
scale_color_manual(values=c('#A9A9A9',"#FF8000" , "#9ECAE1", "#6BAED6", "#4292C6")) +
theme_classic(base_size = 14) +
theme(
axis.text.x = element_text(color="black"),
axis.ticks = element_line(color = "black")
)+
xlab("Accuracy") + ylab("0-back Betas (a.u.)") +
labs(tag = "E")+
scale_y_continuous(limits = c(-2,2))+
geom_smooth(aes(x=Accuracy , y=Hypo3),
method=glm,se=FALSE, show.legend = FALSE, inherit.aes = FALSE, colour = "grey38", linetype = "dashed")
Acc_N2 <- ggplot(Perf_N2, aes(x=Mel, y=Accuracy, fill=as.factor(Mel))) +
geom_boxplot(width=20, show.legend = FALSE) +
scale_fill_manual(values=c('#D9D9D9',"#FDAE6B" , "#9ECAE1", "#6BAED6", "#4292C6"))+
theme_classic(base_size = 14) +
theme(
axis.text.x = element_text(color="black"),
axis.ticks = element_line(color = "black")
)+
xlab("mel EDI") + ylab("Accuracy") +
labs(tag = "A")
ggarrange(N0_3, RT_emo, EAS, ENS, nrow = 2, ncol=2)
ggarrange(Acc_N2, N2_3, N2_1, N2_4, nrow = 2, ncol=2)
\ No newline at end of file
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment