有没有办法通过 R 中的车辆 ID 对 GPS 数据进行排序,以便我可以提取所有车辆的起点

is there a way to sort GPS data by vehicle ID in R so that I can extract the starting point for all the vehicles

我有大约 10,000 个 vehicles.I 的被动 GPS 数据(大约 500000 个空间点)vehicles.I 需要为每个 vehicles.Each 空间点找到与其自身关联的第一个点 id.I需要从每个id中获取第一个点。

如果您的 data.frame 名为 data1 并且列为 vehicleID、x、y 等

data1[order(data1$vehicleID),]

如果你只想return每辆车的第一个点。

data1[data1$vehicleID==1,]