Create normalized pairwise matrix from trajectories with geographic coordinates R

61 views Asked by At

I am dealing with a R list of geographic coordinates that embodies trajectories of drifters during a given period.

My list of data frames looks like this :

 > str(traj_svp_sarg_from_d)

    List of 5
     $ SVP_undrogued_ID_4101647 :'data.frame':  96 obs. of  7 variables:
      ..$ X..date  : Factor w/ 205 levels "2018-03-11","2018-03-12",..: 2 3 4 5 6 7 8 9 10 11 ...
      ..$ time     : Factor w/ 24 levels "00:00:00","00:59:59",..: 2 3 15 15 23 12 21 7 21 21 ...
      ..$ longitude: num [1:96] -61.7 -61.8 -61.8 -61.7 -61.8 ...
      ..$ latitude : num [1:96] 23.6 23.9 24.2 24.3 24.5 ...
      ..$ type     : chr [1:96] "type-0" "type-0" "type-0" "type-0" ...
      ..$ ID       : chr [1:96] "4101647" "4101647" "4101647" "4101647" ...
      ..$ real_type: chr [1:96] "SVP_undrogued" "SVP_undrogued" "SVP_undrogued" "SVP_undrogued" ...
     $ sargassum_like_ID_2591504:'data.frame':  96 obs. of  7 variables:
      ..$ X..date  : Factor w/ 96 levels "2018-03-12","2018-03-13",..: 1 2 3 4 5 6 7 8 9 69 ...
      ..$ time     : Factor w/ 77 levels "00:00:00","00:00:59",..: 74 18 33 50 75 18 72 19 52 1 ...
      ..$ longitude: num [1:96] -61.8 -61.8 -61.7 -61.7 -61.7 ...
      ..$ latitude : num [1:96] 23.8 23.9 24.1 24.3 24.4 ...
      ..$ type     : chr [1:96] "type-1" "type-1" "type-1" "type-1" ...
      ..$ ID       : chr [1:96] "2591504" "2591504" "2591504" "2591504" ...
      ..$ real_type: chr [1:96] "sargassum_like" "sargassum_like" "sargassum_like" "sargassum_like" ...

I have added some NA value for latitude and longitude when data are missing for a given date.

My goal is to compute a normalized pairwise matrix between the trajectories without taking into account the NAs value.

I have started to use distGeo() from geosphere library , that gives me the distance between each point of the trajectories , then I have tried to compute the Frechet distances with the trajectories library but I am stuck due to the NAs values. So as you can see many insights but stuck to get a relevant result ...

Can you give me hints to get a normalized pairwise matrix between trajectories ?

Thank you in advance

0

There are 0 answers