I have this simple code to read shp file and plot in 3D.
library(sf)
library(ggplot2)
library(ggmap) # for fortifying shapefiles
nc <- st_read("shp/polygons.shp")
#plot(st_zm(nc), max.plot = 1)
shapefile_df <- fortify(nc)
map <- ggplot() +
geom_path(data = shapefile_df,
aes(x=long, y=lat, group = group),
color = 'gray', fill = 'white', size = .2)
print(map)
but I am getting an error
Error in `geom_path()`:
! Problem while computing aesthetics.
ℹ Error occurred in the 1st layer.
Caused by error in `FUN()`:
! object 'long' not found
Run `rlang::last_error()` to see where the error occurred.
Here is the nc object