Why does my polygon look like two triangles instead of a box? Can some help explain how I can turn the polygon into a box?
data <- structure(list(AREA = c("a", "a", "b", "b"), Lat = c(43.68389835,
43.68389835, 44.3395883, 44.3395883), Long = c(-88.22909367,
-88.99888743, -88.22909367, -88.99888743)), row.names = c(NA,
-4L), spec = structure(list(cols = list(AREA = structure(list(), class = c("collector_character",
"collector")), Lat = structure(list(), class = c("collector_double",
"collector")), Long = structure(list(), class = c("collector_double",
"collector"))), default = structure(list(), class = c("collector_guess",
"collector")), delim = ","), class = "col_spec"), problems = <pointer: 0x000002548f014500>, class = c("spec_tbl_df",
"tbl_df", "tbl", "data.frame"))
Code:
library(tidyverse)
ggplot() + geom_polygon(data=data, mapping=aes(x=Long, y=Lat))
