I would like to calculate the general aspect for stream segments in R. The stream network has been derived from the DEM and is in 2D. I have split the stream segments into equal parts of 100m (or less) and I have the DEM (1m resolution). (It is possible that the aspect may change (slightly) along each segment but I am interested in the overall or dominant aspect for that segment) [I can see it might possible to use the DEM to create a 3D linestring but I don't know how] I am aware of tools in QGIS and ArcGIS but I would like to make as many of my steps within R as possible (Calculate slope of line segments with QGIS ; Workflow for determining stream gradient?) I had initially asked a [question][1] about slope and aspect but only got an answer for slope so I'm asking it specifically about aspect here. [1]: https://gis.stackexchange.com/questions/384903/calculate-slope-gradient-along-streams-lines-segments-in-r