umr-amap / BIOMASS

https://umr-amap.github.io/BIOMASS/
24 stars 17 forks source link

Error when there isn't any tree in a subplot #45

Closed ArthurBailly closed 1 month ago

ArthurBailly commented 2 months ago

line 208 of summaryByPlot function : when there is no tree in a subplot, the result of AGB[ plot == unique(data$subplot), AGB] returns numeric(0) instead of 0. Then, the sapply of AGB = sapply(list_poly, "[[", 2)) line 212 is not a vector anymore but a list, which leads to an error. Besides, there isn't any test in test_04_summaryByPlot with the subplot argument.