Riksrevisjonen / pioneeR

R package for running a Shiny app for DEA analysis
https://riksrevisjonen.github.io/pioneeR/
GNU General Public License v3.0
6 stars 2 forks source link

`find_scale` returns empty value if max value is < 1 #58

Closed ohjakobsen closed 9 months ago

ohjakobsen commented 9 months ago

https://github.com/Riksrevisjonen/pioneeR/blob/0158e8d1eb0f7352fb0463fd594af58b3e3219bd/inst/app/R/utils.R#L42-L48

The find_scale function will return an empty value if the max value of the input vector is below 1. This can be fixed by setting the first value of the vector i to 0, and also take the absolute value of m in the (unlikely) event that x is negative.