So I am trying to create a line graph which shows scores pre and post intervention for a number of participants. However, the number of participants does not reflect the x axis scale. For example (see picture) the x-axis goes from 2 to 7. But, I want the x axis to only show the participants who completed the questionnaires. e.g. 2,3,5,7. Does anyone know how this can be done? my code is as follows: enter image description here
ggplot(data = my_data, aes(x = Participant)) +
geom_line(aes(y = PRE_QUIP_RS, colour = "PRE QUIP RS")) +
geom_point(aes(y = PRE_QUIP_RS, colour = "PRE QUIP RS")) +
geom_line(aes(y = POST_QUIP_RS, colour = "POST QUIP RS")) +
geom_point(aes(y = POST_QUIP_RS, colour = "POST QUIP RS")) +
scale_colour_manual("",
breaks = c("PRE QUIP RS", "POST QUIP RS"),
values = c("blue", "orange")) +
xlab("Participants ") +
scale_y_continuous("QUIP RS Scores", limits = c(0,30)) +
labs(title="Pre and Post QUIP RS Scores")