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

Group specific prioritization setup #99

Open
ricschuster opened this issue Sep 11, 2018 · 0 comments
Open

Group specific prioritization setup #99

ricschuster opened this issue Sep 11, 2018 · 0 comments

Comments

@ricschuster
Copy link
Member

Adding some functionality in prioritizr to allow group specific prioritization, i.e. splitting up feature input by group.

library(dplyr)
library(tidyr)
df <- data.frame(id = seq(1:10),
                  group = round(2*runif(10),0),
                  feat1 = runif(10),
                  feat2 = runif(10))

df2 <- df %>%
     gather(feature_name, amount, -id, -group) %>%
     mutate(feature_name = paste0(feature_name, "_", group)) %>%
     spread(feature_name, amount, fill = 0)

group is the column that is used to identify groupings in the features.
The scenario is say a country wide setup (df), which is then processed
to also allow state specific priority setting (df2).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant