This function is called within other important functions in the stratifyR package to calculate the objective function values at systematic incremental progressions of stratum width and range of the data
data.root(d, y, c, my_env)
returns the value of the objective function
A numeric: distance or range of data
A numeric: stratum width
A numeric: stratum cost
The environment my_env contains the constants and outputs from various calculations carried out by other key functions
Karuna Reddy <karuna.reddy@usp.ac.fj>
MGM Khan <khan_mg@usp.ac.fj>