Load data

data = read.table("ForceEdgeStudy1.csv", header=TRUE, sep=",")

Filter and aggregate data

# Get only success trials  (2880 true trials)
data_filt = data %>% filter(success == "True")


# Aggregate data 
data_aggr =   data_filt %>% 
              group_by(task, technique, distance) %>%                        # Group data by factors
              summarise(meanTime = mean(time), ci.lower = ci(time)["CI lower"], ci.upper = ci(time)["CI upper"])  # compute means for time and overshoot 

Plot times for Select task

plot_data = data_aggr %>% filter(task == 'Select')
ggplot(plot_data, aes(x = factor(distance), y = meanTime, group = technique, colour = factor(technique))) +
      geom_line(aes(linetype = technique)) +
      scale_linetype_manual("Technique", values = c("dashed", "solid")) +
      scale_color_manual("Technique", values = c("#3333FF","#990000")) +
      geom_errorbar(aes(ymin = ci.lower, ymax = ci.upper), width = .1, position = position_dodge(.05)) +
      expand_limits(y = c(0,15)) +
      theme(legend.position = c(.1, .85),
            legend.box.background = element_rect(size=1, color="black"),
            legend.background = element_rect(size = 0.3, linetype = "solid", colour = "black"),
            panel.background = element_blank(),
            panel.border = element_rect(colour = 'black', fill=NA),
            panel.grid.major.y = element_line( size = .1, color = "grey")
            ) +
      labs(title = "Time (s) for Select", x = "Distance (lines)", y = "Time (s)") 

Plot times for Move task

plot_data = data_aggr %>% filter(task == 'Move')
ggplot(plot_data, aes(x = factor(distance), y = meanTime, group = technique, colour = factor(technique))) +
      geom_line(aes(linetype = technique)) +
      scale_linetype_manual("Technique", values = c("dashed", "solid")) +
      scale_color_manual("Technique", values = c("#3333FF","#990000")) +
      geom_errorbar(aes(ymin = ci.lower, ymax = ci.upper), width = .1, position = position_dodge(.05)) +
      expand_limits(y = c(0,15)) +
      theme(legend.position = c(.1, .85),
            legend.box.background = element_rect(size=1, color="black"),
            legend.background = element_rect(size = 0.3, linetype = "solid", colour = "black"),
            panel.background = element_blank(),
            panel.border = element_rect(colour = 'black', fill=NA),
            panel.grid.major.y = element_line( size = .1, color = "grey")
            ) +
      labs(title = "Time (s) for Move", x = "Distance (lines)", y = "Time (s)")