############### B011 ###################### # set path path = "C:/Experiments/B011/" setwd(path) # Read CSV into R #Note: Data from Subj# 2 (left-hander) and Subj#15 (recording error) are not included in the csv file data <- read.csv(file="B011_Data_for_Analysis.csv", header=TRUE, sep=';') #replace commas by dots in column "maxGA" data$maxGA <- as.numeric(gsub(",", ".", gsub("\\.", "", data$maxGA))) #Frequencies of correct/error trials Error_table <- table(data$Subj,data$correct,data$Compatibility) EF <- prop.table(Error_table, c(1,3)) Error_Freq <- as.data.frame(EF) names(Error_Freq) <- c("Subj", "Correct", "Compatibility", "Freq") require(ggplot2) EFBar <- ggplot(Error_Freq,aes(Subj,Freq, fill = Correct)) + facet_wrap(~Compatibility) EFBar + stat_summary(fun.y = mean, geom = "bar", position = "dodge", color = "black") + scale_fill_manual(values = c("black","white")) + labs(x="Subjects", y = "Frequency")+ theme(panel.background = element_rect(fill = "white")) #Exclude subjects# 16,19,22,29,30 Subj.to.remove <- c(16,19,22,29,30) data <- data[! data$Subj %in% Subj.to.remove,] #Frequencies of different errors #errortype: 0 no error kinematic errors: 0 no error # 1 too fast 1 velocity off # 2 wrong hand 2 bimodal GA # 3 too slow RT 3 acceleration off # 4 correct hand but then error 4 marker loss # 5 too slow AT # 6 marker loss etf <- table(data$errortype) Errortype_Freq <- prop.table(etf) kin_err <- table(data$kinematic.error) Kin_Errortype_Freq <- prop.table(kin_err) # Exclude errors (i.e., errortypes 1-5 & kinematic errors 1 + 4) data <- data[data$errortype==0,] KinErr.to.remove <- c(1,4) data <- data[! data$kinematic.error %in% KinErr.to.remove,] #Factorize data$Subj <- factor(data$Subj) data$Target <- factor(data$Target) data$cong <- factor(data$cong) data$errortype <- factor(data$errortype) data$Block <- factor(data$Block) data$trial <- factor(data$trial) data$kinematic.error <-factor(data$kinematic.error) data$hand <-factor(data$hand) summary(data) ###############Using graphs to explore the data################################# #Histograms Histo <- ggplot(data, aes(RT)) Histo + geom_histogram(aes(fill = Compatibility),binwidth = 20,position = "identity",alpha = 0.7) + labs(x = "RT" , y = "Frequency") +facet_wrap(~hand) + theme(panel.background = element_rect(fill = "white")) Histo + geom_histogram(aes(y=..density..,fill = Compatibility),binwidth = 20,position = "identity",alpha = 0.7) + labs(x = "RT" , y = "Frequency") +facet_wrap(~hand) + theme(panel.background = element_rect(fill = "white")) Histo + geom_histogram(aes(fill = Subj),binwidth = 20,position = "identity",alpha = 0.7) + labs(x = "RT" , y = "Frequency") + theme(panel.background = element_rect(fill = "white")) #Density plots B011Density <- ggplot(data, aes(RT)) B011Density + geom_density(aes(fill = Compatibility),alpha = 0.5)+ labs(x = "RT" , y = "Frequency") +facet_wrap(~hand) B011Density + geom_density(aes(fill = Subj),alpha = 0.5)+ labs(x = "RT" , y = "Frequency") #Boxplots B011Box <- ggplot(data, aes(Subj,RT)) B011Box + geom_boxplot(aes(fill = Compatibility), coef = 3.0) #whiskers = 3.0 x IQR ############################################################################ #Exclude trials in which RT < 200ms or > 750ms and in which MT >1000m table(data$RT<200) table(data$RT>750) table(data$MT>1000) data <- data[data$RT>=200,] data <- data[data$RT<=750,] data <- data[data$MT<=1000,] ################# DATA PLOTTING ######################### #################### RT ################################# #aggregate data agg_data_RT <- with(data, aggregate(RT, list(Subj, Compatibility, hand), mean)) names(agg_data_RT) <- c("Subj", "Compatibility", "hand", "MeanRT") summary(agg_data_RT) #rearrange and export for JAPS library(reshape2) agg_data_wide_RT <- dcast(agg_data_RT, Subj ~Compatibility+hand, value.var = "MeanRT") write.csv2(agg_data_wide_RT, "agg_data_B011_RT.csv") #calculate condition means + credible intervals for plotting agg_data_RT_MCI <- with(agg_data_RT, aggregate(MeanRT, list(Compatibility, hand), mean)) #conditions means + credible intervals inserted from JASP output names(agg_data_RT_MCI) <- c("Compatibility", "hand", "MeanRT") agg_data_RT_MCI$upperCI <- c(331,370,342,368) #these values come from JASP agg_data_RT_MCI$lowerCI <- c(305,334,307,323) #these values come from JASP summary(agg_data_RT_MCI) ##### calculate RT difference (incongruent minus congruent for each hand) ##### MeanRTdiff_LH <- agg_data_RT$MeanRT[agg_data_RT$Compatibility=="incompatible" & agg_data_RT$hand=="left"] - agg_data_RT$MeanRT[agg_data_RT$Compatibility=="compatible" & agg_data_RT$hand=="left"] MeanRTdiff_RH <- agg_data_RT$MeanRT[agg_data_RT$Compatibility=="incompatible" & agg_data_RT$hand=="right"] - agg_data_RT$MeanRT[agg_data_RT$Compatibility=="compatible" & agg_data_RT$hand=="right"] agg_data_RT_diff <- as.data.frame(agg_data_RT[1:24,"Subj"]) agg_data_RT_diff <- cbind(agg_data_RT_diff,MeanRTdiff_LH,MeanRTdiff_RH) names(agg_data_RT_diff) <- c("Subj","left","right") require("tidyr") agg_data_RT_diff <- gather(agg_data_RT_diff, hand, MeanRT_diff, left,right, factor_key=TRUE) agg_data_wide_RT_diff <- dcast(agg_data_RT_diff, Subj ~hand, value.var = "MeanRT_diff") write.csv2(agg_data_wide_RT_diff, "agg_data_B011_RT_diff.csv") agg_data_RT_diff_MCI <- with(agg_data_RT_diff, aggregate(MeanRT_diff, list(hand), mean)) #conditions means + credible intervals inserted from JASP output names(agg_data_RT_diff_MCI) <- c("hand", "MeanRT_diff") agg_data_RT_diff_MCI$upperCI <- c(50,36) #these values come from JASP agg_data_RT_diff_MCI$lowerCI <- c(19,7) #these values come from JASP summary(agg_data_RT_diff_MCI) ## #RT Point plots of aggregated data: agg_data_RT$hand <- as.numeric(agg_data_RT$hand) agg_data_RT_MCI$hand <- as.numeric(agg_data_RT_MCI$hand) B011Point <- ggplot(agg_data_RT,aes(hand,MeanRT, fill = Compatibility)) + geom_point(position = position_jitterdodge(jitter.width=0.05, dodge.width = 0.5), shape = 21, size =5,stroke = 0) + #plot individual data points geom_errorbar(data = agg_data_RT_MCI,aes(ymin=lowerCI, ymax=upperCI), position = position_dodge(width = 0.50), width = 0.2, size=2,alpha = 0.5, color = c("#8b0000","#6A6A6A","#8b0000","#6A6A6A")) + #B011Point <- B011Point + stat_summary(fun.data = mean_cl_normal, geom = "errorbar", position = position_dodge(width=0.50), width = 0.2, size =1,color = c("#003070","#007030","#003070","#007030")) stat_summary(fun.y = mean, geom = "point", shape = 21, size = 15,stroke = 0,alpha = 0.5, position = position_dodge(width=0.50)) + scale_fill_manual(name = "", values=c("#6A6A6A","#8b0000")) + labs(x="Response hand", y = "Reaction time [ms]") + #B011Point <- B011Point + theme(panel.background = element_rect(fill = "white"),text = element_text(size=20)) #theme_classic(base_size = 25) theme(panel.background = element_rect(fill = "white", colour = "black", size =1, linetype = "blank"), axis.line = element_line(color="black", size = 1), text = element_text(size=35,color = "black"), axis.ticks = element_line(color = "black", size = 1), axis.text = element_text(color = "black", size =30), axis.ticks.length = unit(0.3,"cm"), legend.position = "top")+ coord_cartesian(ylim=c(250,400)) + scale_x_continuous(labels=c("left","right"), breaks=c(1,2), limits=c(0.5,2.5), expand=c(0,0)) B011Point ggsave("B011_RT.pdf", width = 28, height = 20, units = "cm") agg_data_RT_diff$hand <- as.integer(agg_data_RT_diff$hand) agg_data_RT_diff_MCI$hand <- as.integer(agg_data_RT_diff_MCI$hand) #RT Point plots of aggregated difference data: B011_diffPoint <- ggplot(agg_data_RT_diff,aes(hand, MeanRT_diff)) + geom_point(#position = position_jitterdodge(jitter.width=0.05, dodge.width = 0.5), size =5,stroke = 0, colour = c("#2F4F4F","#2F4F4F","#2F4F4F","#2F4F4F","#2F4F4F","#2F4F4F","#2F4F4F","#2F4F4F","#2F4F4F","#2F4F4F","#2F4F4F","#2F4F4F", "#2F4F4F","#2F4F4F","#2F4F4F","#2F4F4F","#2F4F4F","#2F4F4F","#2F4F4F","#2F4F4F","#2F4F4F","#2F4F4F","#2F4F4F","#2F4F4F", "#696969","#696969","#696969","#696969","#696969","#696969","#696969","#696969","#696969","#696969","#696969","#696969", "#696969","#696969","#696969","#696969","#696969","#696969","#696969","#696969","#696969","#696969","#696969","#696969")) + #plot individual data points geom_errorbar(data = agg_data_RT_diff_MCI,aes(ymin=lowerCI, ymax=upperCI), position = position_dodge(width = 0.50), width = 0.2, size=2, color = c("#2F4F4F","#696969")) + stat_summary(fun.y = mean, geom = "point", size = 15,stroke = 0,alpha = 0.5, position = position_dodge(width=0.50), colour = c("#2F4F4F","#696969")) + scale_fill_manual(values=c("#2F4F4F","#696969")) + labs(x="Response hand", y = "Reaction time difference [ms]") + theme(panel.background = element_rect(fill = "white", colour = "black", size =1, linetype = "blank"), axis.line = element_line(color="black", size = 1), text = element_text(size=35,color = "black"), axis.ticks = element_line(color = "black", size = 1), axis.text = element_text(color = "black", size =30), axis.ticks.length = unit(0.3,"cm")) + coord_cartesian(ylim=c(-50,150))+ scale_x_continuous(labels=c("left","right"), breaks=c(1,2), limits=c(0.5,2.5), expand=c(0.1,0.1)) B011_diffPoint ggsave("B011_RT_diff.pdf", width = 28, height = 20, units = "cm") ######################################################### #################### MT ################################# agg_data_MT <- with(data, aggregate(MT, list(Subj, Compatibility, hand), mean)) names(agg_data_MT) <- c("Subj", "Compatibility", "hand", "MeanMT") summary(agg_data_MT) #rearrange and export for JAPS library(reshape2) agg_data_wide_MT <- dcast(agg_data_MT, Subj ~Compatibility+hand, value.var = "MeanMT") write.csv2(agg_data_wide_MT, "agg_data_B011_MT.csv") #calculate condition means + cfredible intervals agg_data_MT_MCI <- with(agg_data_MT, aggregate(MeanMT, list(Compatibility, hand), mean)) #conditions means + credible intervals inserted from JASP output names(agg_data_MT_MCI) <- c("Compatibility", "hand", "MeanMT") agg_data_MT_MCI$upperCI <- c(660,645,612,672) #these values come from JASP agg_data_MT_MCI$lowerCI <- c(600,586,557,611) #these values come from JASP summary(agg_data_MT_MCI) #MT Point plots of aggregated data: agg_data_MT$hand <- as.numeric(agg_data_MT$hand) agg_data_MT_MCI$hand <- as.numeric(agg_data_MT_MCI$hand) B011Point <- ggplot(agg_data_MT,aes(hand,MeanMT, fill = Compatibility)) + geom_point(position = position_jitterdodge(jitter.width=0.05, dodge.width = 0.5), shape = 21, size =5,stroke = 0) + #plot individual data points geom_errorbar(data = agg_data_MT_MCI,aes(ymin=lowerCI, ymax=upperCI), position = position_dodge(width = 0.50), width = 0.2, size=2,alpha = 0.5, color = c("#8b0000","#6A6A6A","#8b0000","#6A6A6A")) + #B011Point <- B011Point + stat_summary(fun.data = mean_cl_normal, geom = "errorbar", position = position_dodge(width=0.50), width = 0.2, size =1,color = c("#003070","#007030","#003070","#007030")) stat_summary(fun.y = mean, geom = "point", shape = 21, size = 15,stroke = 0,alpha = 0.5, position = position_dodge(width=0.50)) + scale_fill_manual(name = "", values=c("#6A6A6A","#8b0000")) + labs(x="Response hand", y = "Movement time [ms]") + #B011Point <- B011Point + theme(panel.background = element_rect(fill = "white"),text = element_text(size=20)) #theme_classic(base_size = 25) theme(panel.background = element_rect(fill = "white", colour = "black", size =1, linetype = "blank"), axis.line = element_line(color="black", size = 1), text = element_text(size=35,color = "black"), axis.ticks = element_line(color = "black", size = 1), axis.text = element_text(color = "black", size =30), axis.ticks.length = unit(0.3,"cm"), legend.position = "top")+ coord_cartesian(ylim=c(500,800)) + scale_x_continuous(labels=c("left","right"), breaks=c(1,2), limits=c(0.5,2.5), expand=c(0,0)) B011Point ggsave("B011_MT.pdf", width = 28, height = 20, units = "cm") ########## peak vel ###### agg_data_peakvel <- with(data, aggregate(peak.vel, list(Subj, Compatibility, hand), mean)) names(agg_data_peakvel) <- c("Subj", "Compatibility", "hand", "Meanpeakvel") summary(agg_data_peakvel) #rearrange and export for JASP library(reshape2) agg_data_wide_peakvel <- dcast(agg_data_peakvel, Subj ~Compatibility+hand, value.var = "Meanpeakvel") write.csv2(agg_data_wide_peakvel, "agg_data_B011_peakvel.csv") #calculate condition means + credible intervals agg_data_peakvel_MCI <- with(agg_data_peakvel, aggregate(Meanpeakvel, list(Compatibility, hand), mean)) #conditions means + credible intervals inserted from JASP output names(agg_data_peakvel_MCI) <- c("Compatibility", "hand", "Meanpeakvel") agg_data_peakvel_MCI$upperCI <- c(1291,1360,1392,1308) #these values come from JASP agg_data_peakvel_MCI$lowerCI <- c(1176,1218,1259,1178) #these values come from JASP summary(agg_data_peakvel_MCI) #Peak vel Point plots of aggregated data: agg_data_peakvel$hand <- as.numeric(agg_data_peakvel$hand) agg_data_peakvel_MCI$hand <- as.numeric(agg_data_peakvel_MCI$hand) B011Point <- ggplot(agg_data_peakvel,aes(hand,Meanpeakvel, fill = Compatibility)) + geom_point(position = position_jitterdodge(jitter.width=0.05, dodge.width = 0.5), shape = 21, size =5,stroke = 0) + #plot individual data points geom_errorbar(data = agg_data_peakvel_MCI,aes(ymin=lowerCI, ymax=upperCI), position = position_dodge(width = 0.50), width = 0.2, size=2,alpha = 0.5, color = c("#8b0000","#6A6A6A","#8b0000","#6A6A6A")) + #B011Point <- B011Point + stat_summary(fun.data = mean_cl_normal, geom = "errorbar", position = position_dodge(width=0.50), width = 0.2, size =1,color = c("#003070","#007030","#003070","#007030")) stat_summary(fun.y = mean, geom = "point", shape = 21, size = 15,stroke = 0,alpha = 0.5, position = position_dodge(width=0.50)) + scale_fill_manual(name = "", values=c("#6A6A6A","#8b0000")) + labs(x="Response hand", y = "Peak velocity [mm/s]") + #B011Point <- B011Point + theme(panel.background = element_rect(fill = "white"),text = element_text(size=20)) #theme_classic(base_size = 25) theme(panel.background = element_rect(fill = "white", colour = "black", size =1, linetype = "blank"), axis.line = element_line(color="black", size = 1), text = element_text(size=35,color = "black"), axis.ticks = element_line(color = "black", size = 1), axis.text = element_text(color = "black", size =30), axis.ticks.length = unit(0.3,"cm"), legend.position = "top")+ coord_cartesian(ylim=c(900,1800)) + scale_x_continuous(labels=c("left","right"), breaks=c(1,2), limits=c(0.5,2.5), expand=c(0,0)) B011Point ggsave("B011_peakvel.pdf", width = 28, height = 20, units = "cm") #################### ########## abs tpeak vel ###### agg_data_abstpeakvel <- with(data, aggregate(abs.tpeak.vel, list(Subj, Compatibility, hand), mean)) names(agg_data_abstpeakvel) <- c("Subj", "Compatibility", "hand", "Meanabstpeakvel") summary(agg_data_abstpeakvel) #rearrange and export for JAPS library(reshape2) agg_data_wide_abstpeakvel <- dcast(agg_data_abstpeakvel, Subj ~Compatibility+hand, value.var = "Meanabstpeakvel") write.csv2(agg_data_wide_abstpeakvel, "agg_data_B011_abstpeakvel.csv") #calculate condition means + credible intervals agg_data_abstpeakvel_MCI <- with(agg_data_abstpeakvel, aggregate(Meanabstpeakvel, list(Compatibility, hand), mean)) #conditions means + credible intervals inserted from JASP output names(agg_data_abstpeakvel_MCI) <- c("Compatibility", "hand", "Meanabstpeakvel") agg_data_abstpeakvel_MCI$upperCI <- c(233,240,234,236) #these values come from JASP agg_data_abstpeakvel_MCI$lowerCI <- c(211,215,213,214) #these values come from JASP summary(agg_data_abstpeakvel_MCI) #abs tPeak vel Point plots of aggregated data: agg_data_abstpeakvel$hand <- as.numeric(agg_data_abstpeakvel$hand) agg_data_abstpeakvel_MCI$hand <- as.numeric(agg_data_abstpeakvel_MCI$hand) B011Point <- ggplot(agg_data_abstpeakvel,aes(hand,Meanabstpeakvel, fill = Compatibility)) + geom_point(position = position_jitterdodge(jitter.width=0.05, dodge.width = 0.5), shape = 21, size =5,stroke = 0) + #plot individual data points geom_errorbar(data = agg_data_abstpeakvel_MCI,aes(ymin=lowerCI, ymax=upperCI), position = position_dodge(width = 0.50), width = 0.2, size=2,alpha = 0.5, color = c("#8b0000","#6A6A6A","#8b0000","#6A6A6A")) + #B011Point <- B011Point + stat_summary(fun.data = mean_cl_normal, geom = "errorbar", position = position_dodge(width=0.50), width = 0.2, size =1,color = c("#003070","#007030","#003070","#007030")) stat_summary(fun.y = mean, geom = "point", shape = 21, size = 15,stroke = 0,alpha = 0.5, position = position_dodge(width=0.50)) + scale_fill_manual(name = "", values=c("#6A6A6A","#8b0000")) + labs(x="Response hand", y = "Time to peak velocity [ms]") + #B011Point <- B011Point + theme(panel.background = element_rect(fill = "white"),text = element_text(size=20)) #theme_classic(base_size = 25) theme(panel.background = element_rect(fill = "white", colour = "black", size =1, linetype = "blank"), axis.line = element_line(color="black", size = 1), text = element_text(size=35,color = "black"), axis.ticks = element_line(color = "black", size = 1), axis.text = element_text(color = "black", size =30), axis.ticks.length = unit(0.3,"cm"), legend.position = "top")+ coord_cartesian(ylim=c(150,300)) + scale_x_continuous(labels=c("left","right"), breaks=c(1,2), limits=c(0.5,2.5), expand=c(0,0)) B011Point ggsave("B011_abstpeakvel.pdf", width = 28, height = 20, units = "cm") ####### ########## max Grip Aperture ###### agg_data_maxGA <- with(data, aggregate(maxGA, list(Subj, Compatibility, hand), mean)) names(agg_data_maxGA) <- c("Subj", "Compatibility", "hand", "MeanmaxGA") summary(agg_data_maxGA) #rearrange and export for JAPS library(reshape2) agg_data_wide_maxGA <- dcast(agg_data_maxGA, Subj ~Compatibility+hand, value.var = "MeanmaxGA") write.csv2(agg_data_wide_maxGA, "agg_data_B011_maxGA.csv") #calculate condition means + credible intervals agg_data_maxGA_MCI <- with(agg_data_maxGA, aggregate(MeanmaxGA, list(Compatibility, hand), mean)) #conditions means + credible intervals inserted from JASP output names(agg_data_maxGA_MCI) <- c("Compatibility", "hand", "MeanmaxGA") agg_data_maxGA_MCI$upperCI <- c(72,105,106,74) #these values come from JASP agg_data_maxGA_MCI$lowerCI <- c(69,97,99,68) #these values come from JASP summary(agg_data_maxGA_MCI) #max GA vel Point plots of aggregated data: agg_data_maxGA$hand <- as.numeric(agg_data_maxGA$hand) agg_data_maxGA_MCI$hand <- as.numeric(agg_data_maxGA_MCI$hand) B011Point <- ggplot(agg_data_maxGA,aes(hand,MeanmaxGA, fill = Compatibility)) + geom_point(position = position_jitterdodge(jitter.width=0.05, dodge.width = 0.5), shape = 21, size =5,stroke = 0) + #plot individual data points geom_errorbar(data = agg_data_maxGA_MCI,aes(ymin=lowerCI, ymax=upperCI), position = position_dodge(width = 0.50), width = 0.2, size=2,alpha = 0.5, color = c("#8b0000","#6A6A6A","#8b0000","#6A6A6A")) + #B011Point <- B011Point + stat_summary(fun.data = mean_cl_normal, geom = "errorbar", position = position_dodge(width=0.50), width = 0.2, size =1,color = c("#003070","#007030","#003070","#007030")) stat_summary(fun.y = mean, geom = "point", shape = 21, size = 15,stroke = 0,alpha = 0.5, position = position_dodge(width=0.50)) + scale_fill_manual(name = "", values=c("#6A6A6A","#8b0000")) + labs(x="Response hand", y = "Maximal grip aperture (mm)") + #B011Point <- B011Point + theme(panel.background = element_rect(fill = "white"),text = element_text(size=20)) #theme_classic(base_size = 25) theme(panel.background = element_rect(fill = "white", colour = "black", size =1, linetype = "blank"), axis.line = element_line(color="black", size = 1), text = element_text(size=35,color = "black"), axis.ticks = element_line(color = "black", size = 1), axis.text = element_text(color = "black", size =30), axis.ticks.length = unit(0.3,"cm"), legend.position = "top")+ coord_cartesian(ylim=c(50,130)) + scale_x_continuous(labels=c("left","right"), breaks=c(1,2), limits=c(0.5,2.5), expand=c(0,0)) B011Point ggsave("B011_maxGA.pdf", width = 28, height = 20, units = "cm") ######## ########## time to max Grip Aperture ###### agg_data_abstmaxGA <- with(data, aggregate(abs.tmaxGA, list(Subj, Compatibility, hand), mean)) names(agg_data_abstmaxGA) <- c("Subj", "Compatibility", "hand", "MeanabstmaxGA") summary(agg_data_abstmaxGA) #rearrange and export for JAPS library(reshape2) agg_data_wide_abstmaxGA <- dcast(agg_data_abstmaxGA, Subj ~Compatibility+hand, value.var = "MeanabstmaxGA") write.csv2(agg_data_wide_abstmaxGA, "agg_data_B011_abstmaxGA.csv") #calculate condition means + credible intervals agg_data_abstmaxGA_MCI <- with(agg_data_abstmaxGA, aggregate(MeanabstmaxGA, list(Compatibility, hand), mean)) #conditions means + credible intervals inserted from JASP output names(agg_data_abstmaxGA_MCI) <- c("Compatibility", "hand", "MeanabstmaxGA") agg_data_abstmaxGA_MCI$upperCI <- c(397,406,385,421) #these values come from JASP agg_data_abstmaxGA_MCI$lowerCI <- c(347,355,338,368) #these values come from JASP summary(agg_data_abstmaxGA_MCI) #time to max GA vel Point plots of aggregated data: agg_data_abstmaxGA$hand <- as.numeric(agg_data_abstmaxGA$hand) agg_data_abstmaxGA_MCI$hand <- as.numeric(agg_data_abstmaxGA_MCI$hand) B011Point <- ggplot(agg_data_abstmaxGA,aes(hand,MeanabstmaxGA, fill = Compatibility)) + geom_point(position = position_jitterdodge(jitter.width=0.05, dodge.width = 0.5), shape = 21, size =5,stroke = 0) + #plot individual data points geom_errorbar(data = agg_data_abstmaxGA_MCI,aes(ymin=lowerCI, ymax=upperCI), position = position_dodge(width = 0.50), width = 0.2, size=2,alpha = 0.5, color = c("#8b0000","#6A6A6A","#8b0000","#6A6A6A")) + #B011Point <- B011Point + stat_summary(fun.data = mean_cl_normal, geom = "errorbar", position = position_dodge(width=0.50), width = 0.2, size =1,color = c("#003070","#007030","#003070","#007030")) stat_summary(fun.y = mean, geom = "point", shape = 21, size = 15,stroke = 0,alpha = 0.5, position = position_dodge(width=0.50)) + scale_fill_manual(name = "", values=c("#6A6A6A","#8b0000")) + labs(x="Response hand", y = "Time to maximal grip aperture (ms)") + #B011Point <- B011Point + theme(panel.background = element_rect(fill = "white"),text = element_text(size=20)) #theme_classic(base_size = 25) theme(panel.background = element_rect(fill = "white", colour = "black", size =1, linetype = "blank"), axis.line = element_line(color="black", size = 1), text = element_text(size=35,color = "black"), axis.ticks = element_line(color = "black", size = 1), axis.text = element_text(color = "black", size =30), axis.ticks.length = unit(0.3,"cm"), legend.position = "top")+ coord_cartesian(ylim=c(200,600)) + scale_x_continuous(labels=c("left","right"), breaks=c(1,2), limits=c(0.5,2.5), expand=c(0,0)) B011Point ggsave("B011_abstmaxGA.pdf", width = 28, height = 20, units = "cm") ########