How do I call the index of my data.frame in R like this
x <- index(data) 
y1 <- data$y1
y2 <- data$y2
My data.frame have 3 variables. My ID variables does not have all unique values, as most of my individuals have two scenarios. While the index (provided by R) lists my data from 1:40 (40 values). I want my x-axis to go from 1 to 40.
ID {1, 1, 2, 3, 3, 4, 7, 12, ..., 50, 51, 57, 57}
y1 {....}
y2 {....}
plot(y1) 
plots the index automatically as x-axis. I want to specify this manually.
 
    