forsys-sp / forsysr

An R implementation of the ForSys program
GNU General Public License v3.0
8 stars 3 forks source link

Send specific error state when there are no eligible projects #109

Open runforyourlives opened 1 year ago

runforyourlives commented 1 year ago

When asking forsysr to restrict constraints so much such that there are no eligible projects during a run (e.g. setting the max cost to something really tiny), forsysr returns a hard-to-decipher error. For instance:

forsys::run( ... proj_target_field = stand_cost_field, proj_target_value = 2 ... )

... yields

Error in UseMethod("rename") : no applicable method for 'rename' applied to an object of class "NULL"

This appears to be because the forsysr code is expecting at least one project in its resultant dataset.