I am working on Day 3 part1 of Advent of Code 2019, which involves two wires twisting and turning.
There are two parts to my question:
If I have a data frame with the coordinates where the wire passes and takes a turn (like snake and ladders), how do I form a line? Is there a function I could use?
This is the code I've tried, but to be frank I'm not sure whether it works or not
lines(path1$x, path1$y)
where path1 is the data frame containing those coordinates
After I have formed the two lines, how can I get a data frame containing the points of intersection of those lines?
I have tried the intersect() function which clearly does not work.