Landscape-Data-Commons / terradactyl

Tools for using terrestrial core methods data
Other
3 stars 4 forks source link

gap_cover returns erroneous 0s for AIM breaks if the user provides non-AIM break values #126

Open annack84 opened 1 year ago

annack84 commented 1 year ago

When I run gap_cover with tall=F using breaks that differ from the standard AIM breaks (e.g. breaks = c(30, 150) instead of breaks = c(20, 25, 51, 101, 201)), the output percent data frame still contains columns with the AIM break titles that are filled with 0s. This is misleading because my data does contain gaps that fall within the standard AIM breaks (i.e. those columns should have values >0, or not be returned at all).

The source of the problem is the code chunk at lines 126-155 in gap_cover, which introduces the standard AIM columns even if the user specifies different custom breaks. One possible solution is to introduce the empty standard AIM columns in gap_calc instead, since gap_calc is specifically for the AIM standard indicators while gap_cover allows for non-standard indicators.