Dear R users,
#----------------------------------------------------------------------------------------------------------------------------
#There is table containing 1000 (lat, lon, time) GPS positions, wchich should be recognized and labeled in every row of that #recognized position by label from defined POI vector

 GPS$Lat    =c(9,2.2,2,3,4,5,6,7,2,9,2.1,10,3.3,0 , 6, 8, 9)
 GPS$Lon    =c(0,1  ,1,4,4,5,6,7,2,9,1.1,10,4.2,0 , 6, 1, 9)
 GPS$time   =c(0,1  ,2,3,4,5,6,7,8,9,10 ,11,12 ,13,14,15,16)

# and definition of points of interest:
 POIdef$Lat =c( 2   ,3.2)
 POIdef$Lon =c( 1.1 ,4  )
 POIdef$Lab =c("A"  ,"B") 


# but if there are two recognitized points in the small time difference,
# (within time window of tw=3)
# there should be choosen only one point from POIdef  

#Result expected:

#like in these vectors: 
(GPSfindings$Lat     =c(2.2, 2.1, 3.3    )  )
(GPSfindings$Lon     =c(1  , 1.1, 4.2    )  )
(GPSfindings$time    =c(2  ,10  , 12     )  )
(GPSfindings$Lab     =c("A","A" , "B"    )  )
(GPSfindings$POI_lat =c(2  ,2   , 3.2    )  )
(GPSfindings$POI_lon =c(1.1,1.1 , 4.1    )  )

#and as result obtain marked vector:  
(GPS$Lab=c(NA,"A",NA,NA,NA,NA,NA,NA,NA,"B",NA,NA,NA,NA,NA,NA))


#1) Is that possible without using specialized package?
#2) Any specialized package function realize that?

#------------------------------------------------------------------------------------------------
Thanks for suggestions.
Sincerely, Eugen

	[[alternative HTML version deleted]]

