The function isofit() need to become more flexible so as to allow for the construction of isoscapes with more predictors and isoscapes with no predictor (beyond spatial autocorrelation).
I think that mean_model_fix and disp_model_fix are unfortunately too constrained and will have to go.
Instead, I propose to define:
mean_formula_fix = ~ 1
disp_formula_fix = ~ 1
These arguments should understand RHS formula of the type ~ . as the instruction to use all columns from the data as predictor (except the response variable).
All the other arguments should remain the same.
Required changes in other functions
To make this possible, other functions need to be updated to.
The biggest rework will be to update prepraster() as described in issue #152.
Smaller changes need to happen to isoscape() & isomultiscape(): these functions should check that the structural raster brick contains all the required layers by matching the predictors of the isofit to the names of the layers.
Similarly, calibfit() will require that all required predictors are present in the calibration dataset so that the isotopic source value can be predicted. (Note that it will be difficult for users to fill in these columns if they don't have these data, and they may have to import them from a raster, this will be the object of another issue. We probably need a function prepcalib()).
Goal
The function
isofit()
need to become more flexible so as to allow for the construction of isoscapes with more predictors and isoscapes with no predictor (beyond spatial autocorrelation).Current function
So far the function has been defined as follows:
Arguments
I think that
mean_model_fix
anddisp_model_fix
are unfortunately too constrained and will have to go. Instead, I propose to define:These arguments should understand RHS formula of the type
~ .
as the instruction to use all columns from the data as predictor (except the response variable).All the other arguments should remain the same.
Required changes in other functions
To make this possible, other functions need to be updated to. The biggest rework will be to update
prepraster()
as described in issue #152.Smaller changes need to happen to
isoscape()
&isomultiscape()
: these functions should check that the structural raster brick contains all the required layers by matching the predictors of the isofit to the names of the layers.Similarly,
calibfit()
will require that all required predictors are present in the calibration dataset so that the isotopic source value can be predicted. (Note that it will be difficult for users to fill in these columns if they don't have these data, and they may have to import them from a raster, this will be the object of another issue. We probably need a functionprepcalib()
).