R: In a travel time/distance matrix, how to find which destinations are within 1 hour of an origin point?

67 views Asked by At

Im having some trouble with understanding how to find this piece of information.

Some context: I have a range of origin (LSOA) and destination (MSOA) points which i have found the time and distance it takes to get from each origin to destination point via a matrix from the function dodgr. I then found how many destination points each origin can reach within 1 hour. However I would like to know which destination points these actually are ie corresponding to the destination data names as so far I only have how many can be reached rather than their individual names.

I would be very grateful for any insights thank you!

I don't really know where to start

Here is a picture of the current matrix which has 503 columns (destinations) and 199 rows (origins). This is currently measured in seconds

The code used to produce this matrix is:

odtwalk <- dodgr_times(ntx_walk, from = origin, to = destination, 
                   shortest = FALSE)

Ive used this code to find the number of destinations within 1 hour (3600s) of each origin which I included as a variable in my original origin data frame


    LSOA_Bromley$within_1hour <- rowSums(odtwalk <= 3600)

Here is a picture of the origin data frame with the included column for number of MSOAs reachable within 1 hour.

How can I find the id or name of the MSOAs reachable within an hour instead of the number that can be reached?

Thank you!!

0

There are 0 answers