I'm just trying to make a simple line plot with two conditions: Standard and Deviant.
The Data in the csv originally look something like this:
And yes, time is supposed to be negative. Time is a variable here that goes from -100 ms (100 ms before the event happened) to 1500 ms (1500 ms after the event happened).
Essentially, what I am trying to do is plot how the values (which I will later call amplitude) change over time for both Standard and Deviant Conditions. Something that looks kind of like this:
Unfortunately, what I'm getting is this:
Here is my code:
# Libraries
library(ggplot2)
# Plotting
ggplot(data=PupilERP, aes(x=Pt, y=Amplitude, group=Condition)) +
geom_line() + scale_y_continuous(breaks = seq(-5,15,1)) + scale_x_continuous(breaks = seq(-100,1500,100))
Edit: As asked for in the comments, here is the sample data once I have gotten past line 8- occurs after this line colnames(PupilERP) <- c("Pt","Deviant","Standard")
Also, someone else asked for the dput output. Tt was way too long at this point to give you the data (after the colnames line), even up to just 20 points, so after I have done ALL of the reshaping, after here is the actual dput output.
structure(list(Pt = c(13L, 110L, 109L, 108L, 107L, 106L, 105L,
104L, 103L, 102L, 101L, 99L, 98L, 97L, 96L, 95L, 94L, 93L, 92L,
91L), Condition = c("Deviant", "Deviant", "Deviant", "Deviant",
"Deviant", "Deviant", "Deviant", "Deviant", "Deviant", "Deviant",
"Deviant", "Deviant", "Deviant", "Deviant", "Deviant", "Deviant",
"Deviant", "Deviant", "Deviant", "Deviant"), Amplitude = c(0.0089,
-0.0066, -0.0076, 0.0105, 0.0514, 0.111, 0.178, 0.2396, 0.2851,
0.306, 0.2999, 0.2708, 0.2277, 0.1796, 0.1318, 0.085, 0.0399,
0.0012, -0.0264, -0.0413)), row.names = c(NA, 20L), class = "data.frame")