powered by
create an spatiallineobject from 2 points, optional export as shapefile
sp_line(Y_coords, X_coords, ID, proj4 = "+proj=longlat +datum=WGS84 +no_defs", export = FALSE)
Y/lat coordinates
X/lon coordinates
id of line
projection
write shafefile default = F
# NOT RUN { ## creating sp spatial point object line <- sp_line(c(8.770367,8.771161,8.771536),c(50.815172,50.814743,50.814875),ID="go for it") ## plot it raster::plot(line) # }
Run the code above in your browser using DataLab