Connect two points with a line in R
<p>I have a problem connecting two points with the same y value. My dataset looks like this <em>(I hope the formatting is ok)</em>: </p>

<pre><code>attackerip,min,max
125.88.146.123,2016-03-29 17:38:17.949778,2016-03-30 07:28:47.912983
58.218.205.101,2016-04-05 15:53:20.69986,2016-05-12 17:32:08.583255
183.3.202.195,2016-04-05 15:58:27.862509,2016-04-15 18:15:13.117774
58.218.199.166,2016-04-05 16:09:34.448588,2016-04-24 06:02:12.237922
58.218.204.107,2016-04-05 16:57:17.624509,2016-05-31 00:52:44.007908
</code></pre>

<p>What I have so far is the following:</p>

<pre><code>mydata = read.csv("timeline.csv", sep=',')
mydata$min &lt;- strptime(as.character(mydata$min), format='%Y-%m-%d %H:%M:%S')
mydata$max &lt;- strptime(as.character(mydata$max), format='%Y-%m-%d %H:%M:%S')
plot(mydata$min, mydata$attackerip, col="red")
points(mydata$max, mydata$attackerip, col="blue")
</code></pre>

<p>Which results in: <a href="https://i.stack.imgur.com/LDDcv.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/LDDcv.jpg" alt="this Plot"></a></p>

<p>Now I want to connect the points with the same y-axis value. And can not get lines or abline to work. Thanks in Advance!</p>

<p>EDIT: dput of data</p>

<pre><code>dput(mydata)
structure(list(attackerip = structure(c(1L, 5L, 2L, 3L, 4L), .Label = c("125.88.146.123", 
"183.3.202.195", "58.218.199.166", "58.218.204.107", "58.218.205.101"
), class = "factor"), min = structure(1:5, .Label = c("2016-03-29 17:38:17.949778", 
"2016-04-05 15:53:20.69986", "2016-04-05 15:58:27.862509", "2016-04-05 16:09:34.448588", 
"2016-04-05 16:57:17.624509"), class = "factor"), max = structure(c(1L, 
4L, 2L, 3L, 5L), .Label = c("2016-03-30 07:28:47.912983", "2016-04-15 18:15:13.117774", 
"2016-04-24 06:02:12.237922", "2016-05-12 17:32:08.583255", "2016-05-31 00:52:44.007908"
), class = "factor")), .Names = c("attackerip", "min", "max"), class = "data.frame", row.names = c(NA, 
-5L))
</code></pre>

<p>Final Edit:</p>

<p>The reason why plotting lines did not work was, that the datatype of min and max was timestamps. Casting those to numeric values yielded the expected result. Thanks for your help everyone</p>