我有一个很大的数据集,数据点随着时间的推移偶尔收集。基本上,它是GPS跟踪数据,当接收天线到达时收集数据——然而,分辨率有时可能太高,例如每分钟左右——这是不必要的,这使得绘制地图成为一项处理挑战,因此我想减少它。
我能做的最好的方法就是以某种方式过滤数据,使每小时的日期和时间是唯一的——这将减少分钟数据点的数量。然而,它也必须由一个单独的标识符来完成——在本例中是“名称”。因为某些日期/时间可能会与具有不同名称的对象交叉。
我并不特别担心哪一行是根据每个小时选择的,也不需要求平均值等等。你有什么想法吗?
以下是一些虚拟数据:
df <- structure(list(`Local Time` = structure(c(1559388960, 1559389200,
1559394840, 1559397180, 1559397900, 1559398380, 1559398560, 1559398680,
1559398740, 1559398800, 1559399160, 1559399280, 1559399400, 1559399580,
1559399640, 1559399820, 1559399940, 1559400120, 1559400240, 1559400780,
1559400840, 1559400960, 1559401080, 1559401260, 1559401380, 1559383560,
1559389200, 1559389440, 1559395080, 1559395320, 1559397180, 1559397900,
1559398200, 1559398440, 1559398680, 1559398920, 1559399220, 1559399520,
1559399820, 1559400120, 1559400360, 1559400660, 1559400960, 1559401200,
1559401500, 1559401740, 1559402040, 1559402280, 1559402580, 1559402880
), class = c("POSIXct", "POSIXt"), tzone = ""), COG = c(315,
352.6, 265.6, 214.9, 240.8, 245.5, 240.3, 250.5, 262.4, 269.8,
281.1, 262.9, 253.1, 247.7, 255.5, 249.4, 263.2, 268.6, 279.6,
274.3, 254.6, 246.6, 253.7, 242.3, 163.5, 90, 88, 89, 93, 96,
95, 97, 97, 98, 98, 95, 93, 94, 92, 91, 91, 91, 91, 90, 90, 92,
89, 89, 89, 88), NAME = c("Aur", "Aur", "Aur", "Aur", "Aur",
"Aur", "Aur", "Aur", "Aur", "Aur", "Aur", "Aur", "Aur", "Aur",
"Aur", "Aur", "Aur", "Aur", "Aur", "Aur", "Aur", "Aur", "Aur",
"Aur", "Aur", "Cos", "Cos", "Cos", "Cos", "Cos", "Cos", "Cos",
"Cos", "Cos", "Cos", "Cos", "Cos", "Cos", "Cos", "Cos", "Cos",
"Cos", "Cos", "Cos", "Cos", "Cos", "Cos", "Cos", "Cos", "Cos"
)), row.names = c(NA, -50L), class = c("tbl_df", "tbl", "data.frame"))