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

Weird add_constr_custom() behaviors #173

Closed
2 tasks
christopherkenny opened this issue Nov 3, 2023 · 2 comments
Closed
2 tasks

Weird add_constr_custom() behaviors #173

christopherkenny opened this issue Nov 3, 2023 · 2 comments
Milestone

Comments

@christopherkenny
Copy link
Member

christopherkenny commented Nov 3, 2023

  • If a call to a function is present using ::, you get the following warning.
Error in `rlang::as_string()`:
! Can't convert a call to a string.

Workaround: Define the required function in the global environment before using it, like colMins <- matrixStats::colMins before declaring the custom constraint.

  • Sub-redist_maps after filtering fail if you rely on the district number and the numbers are not sequential. On an example Iowa map, filter out district 2 and then try to subset to access district 2, causing a NaN issue.
    Workaround: renumber the existing_col when you create the map
@christopherkenny
Copy link
Member Author

christopherkenny commented Nov 3, 2023

:: issue fixed by explicitly using a child environment. That's wrong, still broken.

@CoryMcCartan
Copy link
Member

Can you elaborate on the 2nd issue?

Shouldn't accessing indices that don't exist cause problems?

CoryMcCartan added a commit that referenced this issue Nov 7, 2023
@christopherkenny christopherkenny added this to the 4.2 milestone Jan 4, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants