create two points using latitude and longitutde coordinates then using st_cast draw a line connecting the two in r
# Load required packageslibrary(sf)
# Define the latitude and longitude coordinates for the two pointspoint1 <- st_point(c(-122.4194, 37.7749)) # Point 1 (Longitude, Latitude)
point2 <- st_point(c(-122.0308, 36.9729)) # Point 2 (Longitude, Latitude)
# Combine the two points into a linestringline <- st_cast(st_sfc(c(point1, point2)), "LINESTRING")
# Plot the line connecting the two pointsplot(st_sfc(line), axes = TRUE)