I am working with a data frame consisting of points. Take the data below as fake example of the points I observe for individual i:
D <- tibble(trip_long = c(-87.7, -87.6, -87.6, -87.7, -87.7, -87.8, -87.5, -87.6, -87.6, -87.6,
-87.7, -87.6, -87.6, -87.6, -87.6, -87.6, -87.6, -87.7, -87.7, -87.6),
trip_lat = c(41.7, 41.8, 41.7, 41.7, 41.7, 41.7, 41.6, 41.7, 41.8, 41.8, 41.7, 41.7,
41.7, 41.7, 41.7, 41.7, 41.8, 41.7, 41.7, 41.7))
I want to calculate the standard deviation ellipse of the points for this individual, for which I am using the aspace library.
library(aspace)
sde <- calc_sde(id = 1, points = D))
sde contains the my standard deviation ellipse:
I want to extract that ellipse as a geometry column for all of my observations, but I have not managed to figure out how to do it yet.
I am not totally sure if this is a possibility.
It is not clear, what you like to achieve. Pleae specify. A wild guess:
I would like to mention that there are only five different data points, see
A routine, how to use the result of
calc_sdeto extract attributes of the ellipse? Simply look atYou can use the information to plot a ellipse. Try
Created on 2023-10-18 with reprex v2.0.2