You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In troubleshooting ohicore::CalculateAll() line-by-line, I found that while that error came to light when calculating Likely Future, the problem actually occurred earlier when creating the scores variable. The scores variable was much larger than it should be by the time it was used to calculate Likely Future. I was expecting the scores variable to be 14_goal_functions * 4_regions * 2_dimensions = 112, but it was 192! Odd, because it wasn't doubled, but was definitely too long, and upon inspection it definitely had duplicates that were causing problems when trying to calculate Likely Future.
SO! I went back to where the scores variable was created and walked through each iteration of the for loop, watching the scores variable to see if it was the expected multiple of 8 (4_regions * 2_dimensions). And when I got to g='HAB', it grew by about 100 rather than 8!
Looking back at the MHI repo's functions.r, I found that the HAB function was returning the wrong variable; it was returning 'scores' rather than 'scores_HAB'. So what this means is that when ohicore got to HAB, it pasted all previous scores instead of the HAB scores (and actually excluded HAB)
Fixing this then solved the original issue, no more Error: Duplicate identifiers for rows!
This was a problem MHI encountered when running
CalculateAll()
:In troubleshooting
ohicore::CalculateAll()
line-by-line, I found that while that error came to light when calculating Likely Future, the problem actually occurred earlier when creating thescores
variable. Thescores
variable was much larger than it should be by the time it was used to calculate Likely Future. I was expecting thescores
variable to be 14_goal_functions * 4_regions * 2_dimensions = 112, but it was 192! Odd, because it wasn't doubled, but was definitely too long, and upon inspection it definitely had duplicates that were causing problems when trying to calculate Likely Future.SO! I went back to where the
scores
variable was created and walked through each iteration of the for loop, watching thescores
variable to see if it was the expected multiple of 8 (4_regions * 2_dimensions). And when I got to g='HAB', it grew by about 100 rather than 8!Looking back at the MHI repo's
functions.r
, I found that the HAB function was returning the wrong variable; it was returning 'scores' rather than 'scores_HAB'. So what this means is that when ohicore got to HAB, it pasted all previous scores instead of the HAB scores (and actually excluded HAB)Fixing this then solved the original issue, no more
Error: Duplicate identifiers for rows
!cc @eschemmel
The text was updated successfully, but these errors were encountered: