I'm working on plotting data with the Indometh data set.
There's an extra line connecting the first and last data points of each subject. How do I remove this line? Is it an issue with how my data is sorted?
My code:
plot(Indometh$time, Indometh$conc, type = "l")
Edited:
Solution:
plot(Indometh$time[Indometh$Subject == "1"], Indometh$conc[Indometh$Subject == "1"])
## Line for subject 2
lines(Indometh$time[Indometh$Subject == "2"], Indometh$conc[Indometh$Subject == "2"])