Sounds straightforward; does this solve your problem?
library(tidyverse)
set.seed(42)
n <- 100
dat <- data.frame(Participant = 1:n,
Environment = rep(LETTERS[1:2], n/2),
Condition = rep(LETTERS[25:26], n/2),
Gate = sample(1:5, n, replace = TRUE),
Block = sample(1:2, n, replace = TRUE),
Sound = rep(LETTERS[3:4], n/2),
Correct = sample(0:1, n, replace = TRUE)
)
dat %>%
mutate(Gate = factor(Gate),
Sound = factor(Sound)) %>%
group_by(Condition, Gate, Sound) %>%
summarize(Accuracy = mean(Correct),
sd = sd(Correct)/sqrt(length(Correct))) %>%
ggplot(aes(x = Gate, y = Accuracy, color = Sound, group = Sound)) +
geom_line() +
geom_errorbar(aes(ymin = Accuracy - sd, ymax = Accuracy + sd,)) +
scale_y_continuous(labels = scales::percent)+
facet_wrap(~Condition) +
theme_minimal()
#> `summarise()` has grouped output by 'Condition', 'Gate'. You can override using the `.groups` argument.

# Change colour of lines
dat %>%
mutate(Gate = factor(Gate),
Sound = factor(Sound)) %>%
group_by(Condition, Gate, Sound) %>%
summarize(Accuracy = mean(Correct),
sd = sd(Correct)/sqrt(length(Correct))) %>%
ggplot(aes(x = Gate, y = Accuracy, color = Sound, group = Sound)) +
geom_line() +
geom_errorbar(aes(ymin = Accuracy - sd, ymax = Accuracy + sd,)) +
scale_y_continuous(labels = scales::percent)+
facet_wrap(~Condition) +
theme_minimal() +
scale_color_brewer(palette = "Set1")
#> `summarise()` has grouped output by 'Condition', 'Gate'. You can override using the `.groups` argument.

# Add points
dat %>%
mutate(Gate = factor(Gate),
Sound = factor(Sound)) %>%
group_by(Condition, Gate, Sound) %>%
summarize(Accuracy = mean(Correct),
sd = sd(Correct)/sqrt(length(Correct))) %>%
ggplot(aes(x = Gate, y = Accuracy, color = Sound, group = Sound)) +
geom_line() +
geom_errorbar(aes(ymin = Accuracy - sd, ymax = Accuracy + sd)) +
geom_point() +
scale_y_continuous(labels = scales::percent)+
facet_wrap(~Condition) +
theme_minimal() +
scale_color_brewer(palette = "Set1")
#> `summarise()` has grouped output by 'Condition', 'Gate'. You can override using the `.groups` argument.

# different coloured lines, larger points
dat %>%
mutate(Gate = factor(Gate),
Sound = factor(Sound)) %>%
group_by(Condition, Gate, Sound) %>%
summarize(Accuracy = mean(Correct),
sd = sd(Correct)/sqrt(length(Correct))) %>%
ggplot(aes(x = Gate, y = Accuracy, color = Sound, group = Sound)) +
geom_line() +
geom_errorbar(aes(ymin = Accuracy - sd, ymax = Accuracy + sd), color = "grey75") +
geom_point(size = 3) +
scale_y_continuous(labels = scales::percent)+
facet_wrap(~Condition) +
theme_minimal() +
scale_color_brewer(palette = "Set1")
#> `summarise()` has grouped output by 'Condition', 'Gate'. You can override using the `.groups` argument.

Created on 2022-02-09 by the reprex package (v2.0.1)
I highly recommend the books ggplot2: Elegant Graphics for Data Analysis and the R Graphics Cookbook for further information/examples (both free to read online)