# Inside a data.table
dt <- data.table::data.table(
lat = c(1, 1, 1, 1, 1),
lon = c(1, 1.5, 4, 1.5, 2),
timestamp = c(100, 200, 300, 600, 900)
)
dt[, radiusOfGyrationDT(lat, lon, timestamp)]
# As vectors
radiusOfGyrationDT(
c(1, 1, 1, 1, 1),
c(1, 1.5, 4, 1.5, 2),
c(100, 200, 300, 600, 900)
)
Run the code above in your browser using DataLab