Draw lines between all the coordinates in a plot

Viewed 1629

I have the following dataframe:

data <- data.frame(x = c(5,1,3,2,5,7,12), y = c(5,7,6,1,3,5,6))

I can plot these coordinates with the ggplot function and draw a line between these coordinates:

ggplot(data, aes(x, y)) + geom_point(size = 3) + geom_line() 

So far, no problems. But instead of a single line though the coordinates, I want that a line is drawn between all the coordinates. Creating a sort of spider web between all the coordinates. Is this possible in the ggplot2 package?

2 Answers
Related