I am trying to create a line graph that shows response times for a Go/No-go task. I am having trouble with the lines as they are not connecting to the intended values. I just want the 'go' to all be one line and the 'no-go' to be one line. Does anyone know how to correct this? I have included how the line graph looks currently and an example of the dataset. thank you!
> ggplot(response_times, aes(x = day, y = mean, group = 2)) +
geom_line(aes(color = trialtype)) +
geom_point(aes(color = trialtype)) +
theme(axis.text.x = element_text(angle = 60)) +
labs(title="Average response time of Go/No-go Trials",
x = "Date of training",
y = " Average Response Time ")
# Groups: day [28]
day trialtype mean
<chr> <chr> <dbl>
1 2022-08-06 go 0.497
2 2022-08-06 nogo 0.548
3 2022-08-07 go 0.449
4 2022-08-07 nogo 0.407
5 2022-08-08 go 0.444
6 2022-08-08 nogo 0.350
7 2022-08-09 go 0.443
8 2022-08-09 nogo 0.453
9 2022-08-10 go 0.462
10 2022-08-10 nogo 0.426
# … with 46 more rows
EDIT:
So I have used the code which you have provided(thank you) but now i think there is an issue with missing values.
Warning messages:
1: Removed 1 row(s) containing missing values (geom_path).
2: Removed 9 rows containing missing values (geom_point).