Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add geographical methods #4

Open
MikeJohnPage opened this issue Sep 4, 2024 · 7 comments
Open

Add geographical methods #4

MikeJohnPage opened this issue Sep 4, 2024 · 7 comments
Labels
enhancement New feature or request

Comments

@MikeJohnPage
Copy link
Member

MikeJohnPage commented Sep 4, 2024

  • Should this package be able to work with spatial data (e.g., sf)?
  • Should geographical functions such as this be incorporated?
@MikeJohnPage MikeJohnPage added the enhancement New feature or request label Sep 4, 2024
@matthewgthomas
Copy link
Member

Aggregating indices to different levels of geography is a key part of making an index, so let's move those geographical aggregation functions into this package.

{compositr} doesn't necessarily need to work with spatial data though. The aggregation functions just need lookup tables (provided by {geographr}) and population counts (provided by {geographr}) but I can't think of any need for boundaries and other spatial data.

@MikeJohnPage
Copy link
Member Author

Should calculate_extent() and calculate_proportion() be removed from geographr once they are added to compositr (I think so)?

@matthewgthomas
Copy link
Member

Yes please. They're also separately implemented and used in IMD, so can be removed from there too once added to compositr.

@MikeJohnPage
Copy link
Member Author

MikeJohnPage commented Oct 4, 2024

I've been reviewing/refactoring the existing methods, and am confused about what you currently have for calculate_proportion: https://github.com/humaniverse/geographr/blob/ed416a6735f7c4d8da0b866260369e84c27319a2/R/calculate.R#L99

@matthewgthomas

  1. Why do you limit the calculation of proportions to only two possible values?
  2. The function description say "Calculate proportion of small areas in the higher-level geography that are within the 10% most deprived areas in the nation." Yet, the function appears to just calculate the proportions of different groups within a higher-level geography. What is the goal of the function? What should it achieve?

@matthewgthomas
Copy link
Member

The main purpose of the function is to aggregate data from a smaller unit (e.g. LSOA) into higher-level units (e.g. LA).

The original goal of the function was to calculate the proportion of X% most deprived/vulnerable/etc. areas within a higher-level geography - see https://github.com/humaniverse/IMD/blob/master/R/proportion.R

I've completely forgotten why I generalised this function beyond its original purpose - and I clearly forgot to change the function description to reflect that it was generalised.

@MikeJohnPage
Copy link
Member Author

Which version do you want adding in compositr? Generalised?

Would a version which allows the user to set the percentage threshold be helpful (e.g., 10% most deprived, 20% most deprived, etc.)?

@matthewgthomas
Copy link
Member

matthewgthomas commented Oct 15, 2024

Let's use the generalised version.

Would a version which allows the user to set the percentage threshold be helpful (e.g., 10% most deprived, 20% most deprived, etc.)?

This would be brilliant, thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants