【发布时间】:2018-05-16 17:13:27
【问题描述】:
我有一个如下所示的数据框:
C <- data.frame(A_Latitude = c(48.4459, 48.7 , 49.0275, 49.0275, 49.0275, 49.0275, 48.4459),
A_Longitude = c(9.989 , 8.15 , 8.7539 , 8.7539 , 8.7539 , 8.7539 , 9.989 ),
B_Latitude = c(49.0275, 48.4734, 48.4459, 48.9602, 48.9602, 48.4459, 49.0275),
B_Longitude = c(8.7539 , 9.227 , 9.989 , 9.2058 , 9.2058 , 9.989 , 8.7539 ))
数据框由一组两个位置(A + B;即A_Latitude/A_Longitude、B_Latitude/B_Longitude)的纬度/经度坐标组成。
我想根据组合集删除重复项(即,删除位置 A/位置 B 等于位置 B /位置 A 的行条目;即具有 A_Latitude / A_Longitude / B_Latitude / 的行B_Longitude = B_Latitude / B_Longitude / A_Latitude / A_Longitude.
[Finding unique combinations irrespective of position [duplicate]] 和 [Removing duplicate combinations (irrespective of order)] 的答案没有帮助,因为这些解决方案没有考虑组合的列集(在考虑全球位置时,这与此处相关(例如,纬度/经度坐标对于一个位置是等效的) )。
提前感谢您的帮助。
【问题讨论】:
标签: r dataframe geolocation