ipeaGIT / accessibility

Calculate accessibility measures in R
https://ipeagit.github.io/accessibility/
Other
52 stars 9 forks source link

palma_ratio() and concentration_index() throwing warnings #42

Closed dhersz closed 1 year ago

dhersz commented 1 year ago

Since we have decided to be more "picky" with land_use_data in accessibility functions, I decided to be more picky with sociodemographic_data in inequality functions.

The problem is that our sociodemographic dataset contains some NAs in the income_per_capita column. This happens because these entries have population = 0 (and that's expected, because the income there is 0, and divided by the total population, 0, we would have 0/0 = NaN).

In the end, these NA don't really affect calculation.

So I think it's safe not to raise this warning when income per capita columns contain some NA values, as long as they as their correspondent population entry equals to 0. Both functions require users to specify population columns as well, so we can implement this without requiring additional input.

dhersz commented 1 year ago

Done in https://github.com/ipeaGIT/accessibility/commit/33319e901342caed5a8402794e47157a73848486.