0

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!!

yuyumew
  • 1
  • 1
  • Welcome to Stack Overflow. Please read [how to create a minimal, reproducible example](https://stackoverflow.com/questions/5963269/how-to-make-a-great-r-reproducible-example) and [How to ask](https://stackoverflow.com/help/how-to-ask). Specifically please include some code to generate a small matrix with the same format as your data. It's hard to respond without knowing whether, for example, the names are stored in a row or column of a dataframe or as matrix row/column names. – SamR Jan 25 '23 at 18:06
  • Thanks for editing. But it still cannot be replicated without `ntx_walk`. See [question 1](https://stackoverflow.com/questions/75235768/function-that-tabulates-for-specific-values-and-returns-counts) from earlier today for how to create _minimal_ sample data from scratch or [question 2](https://stackoverflow.com/questions/75219563/ggpubr-and-ggbarplot-how-to-change-data-labels-to-percent-format) that includes data as you could with `dput(head(ntx_walk))`. Also please [don't post text as images](https://meta.stackoverflow.com/questions/285551/why-should-i-not-upload-images-of-code-data-errors) – SamR Jan 25 '23 at 18:41
  • Greetings! As suggested by others, usually it is helpful to provide a minimally reproducible dataset for questions here so people can troubleshoot your problems (rather than a table or screenshot for example). One way of doing is by using the `dput` function on the data or a subset of the data you are using, then pasting the output into your question. You can find out how to use it here: https://youtu.be/3EID3P1oisg – Shawn Hemelstrand Jan 26 '23 at 00:46

0 Answers0