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
Working with @rftapilatu, we saved and registered an updated hab_mangrove_extent layer for bali (commit).
Then, we reran calculate_scores.Rto check that this had worked, but we got the following errors. This is a record of how I troubleshooted to see what was going on and fixed the problems so that we could recalculate OHI scores with this updated data layer. All these errors turned to be because of the way we had structured this updated data layer. The main thing is that when you substitute an existing data layer, make sure that it has the same structure as the global one, or you'll need to update the code to accommodate any differences.
Error: by can't contain join column "year" which is missing from RHS. This was obviously something to do with the "year" column in our new layer, but I didn't see it at first. I walked through the CS function line-by-line and then realized that the problem was that our layer had a column named years but it should have been year (commit).
I tried rerunning calculate_scores.R again and got past that error to a new one: Error in rbind(deparse.level, ...) : numbers of columns of arguments do not match.
This is because the other hab_* layers have an additional column called habitat. Fixed with this commit.
That got us past that error and onto another one: Error in match.names(clabs, names(xi)) : names do not match previous names.
This is because the data for seagrass and saltmarsh are measured in square kilometers, not hectares. I'm not sure if the Bali team will end up removing these habitats or not, but for the meantime, I translated hectares to km2 and re-saved the layer (commit)
Next error: Error in match.names(clabs, names(xi)) : names do not match previous names.
This was because I had forgotten to update layers.csv, where we had registered "hab_mangrove_extent" as having units of "area_ha". Once I updated layers.csv, it ran correctly!
Updating this layer actually affected scores for CS, CP, BD, and the overall Index score (commit. It will be important to revisit functions.r and make sure that the global models and reference points are appropriate for Bali.
The text was updated successfully, but these errors were encountered:
Working with @rftapilatu, we saved and registered an updated
hab_mangrove_extent
layer for bali (commit).Then, we reran
calculate_scores.R
to check that this had worked, but we got the following errors. This is a record of how I troubleshooted to see what was going on and fixed the problems so that we could recalculate OHI scores with this updated data layer. All these errors turned to be because of the way we had structured this updated data layer. The main thing is that when you substitute an existing data layer, make sure that it has the same structure as the global one, or you'll need to update the code to accommodate any differences.Error:
bycan't contain join column "year" which is missing from RHS
. This was obviously something to do with the "year" column in our new layer, but I didn't see it at first. I walked through the CS function line-by-line and then realized that the problem was that our layer had a column namedyears
but it should have beenyear
(commit).I tried rerunning
calculate_scores.R
again and got past that error to a new one:Error in rbind(deparse.level, ...) : numbers of columns of arguments do not match
.This is because the other
hab_*
layers have an additional column calledhabitat
. Fixed with this commit.That got us past that error and onto another one:
Error in match.names(clabs, names(xi)) : names do not match previous names
.This is because the data for seagrass and saltmarsh are measured in square kilometers, not hectares. I'm not sure if the Bali team will end up removing these habitats or not, but for the meantime, I translated hectares to km2 and re-saved the layer (commit)
Next error:
Error in match.names(clabs, names(xi)) : names do not match previous names
.This was because I had forgotten to update
layers.csv
, where we had registered "hab_mangrove_extent" as having units of "area_ha". Once I updatedlayers.csv
, it ran correctly!Updating this layer actually affected scores for CS, CP, BD, and the overall Index score (commit. It will be important to revisit functions.r and make sure that the global models and reference points are appropriate for Bali.
The text was updated successfully, but these errors were encountered: