You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the context of allowing for the construction of isoscapes with more predictors and isoscapes with no predictor (beyond spatial autocorrelation), prepraster() should be modified so as to build an adequate structural raster object for the task.
The new version of prepraster() should allow one to create a structural raster (as before and backward compatible) or raster brick that will contain all information for predictions.
Inputs
The new requirement would be that the user can pass either all the rasters that need to be combined (not necessarily matching in terms of spatial range and cropping) or no raster at all.
The first argument could thus be ... or alternatively something like rasters_list.
I guess that rasters_list would present the benefit of being backward compatible due to partial matching (to check).
The drawback is that lists are always more awkward as inputs, but we already use them for other functions, so it would not be inconsistent.
We also need a new argument or set of arguments to define the resolution of the raster brick for situations for which there is no raster. Perhaps something like manual_res, where the input would be the number of cells?
In the presence of multiple rasters, the resolution could be defined based on whichever raster the user wants.
So we could have two arguments raster_template_res and raster_template_crop for the user to define the name of the raster to be used as a basis for cropping and resolution. raster_template_crop would be overridden by isofit which could be relabelled isofit_crop for clarity.
The other arguments can stay as they are, but some of them will have to behave differently.
In particular, aggregation_fn and values_to_zero should allow for users to define different input per raster layer.
Not provided as a list, such arguments should work as they are now for a raster with a single layer or assume (at least for aggregation_fn but probably not for values_to_zero) for the case of multiple layers that the same thing applies to all layer.
The user should also be able to input named lists with names referring the raster layers to apply different setting on each layers. aggregation_factor should apply to the raster selected via raster_template_res.
Proposal
I thus propose to revise the list of arguments as follows:
Goal
In the context of allowing for the construction of isoscapes with more predictors and isoscapes with no predictor (beyond spatial autocorrelation),
prepraster()
should be modified so as to build an adequate structural raster object for the task.Current function
So far the function has been defined as follows:
New output
The new version of
prepraster()
should allow one to create a structural raster (as before and backward compatible) or raster brick that will contain all information for predictions.Inputs
The new requirement would be that the user can pass either all the rasters that need to be combined (not necessarily matching in terms of spatial range and cropping) or no raster at all.
The first argument could thus be
...
or alternatively something likerasters_list
.I guess that
rasters_list
would present the benefit of being backward compatible due to partial matching (to check).The drawback is that lists are always more awkward as inputs, but we already use them for other functions, so it would not be inconsistent.
We also need a new argument or set of arguments to define the resolution of the raster brick for situations for which there is no raster. Perhaps something like
manual_res
, where the input would be the number of cells?In the presence of multiple rasters, the resolution could be defined based on whichever raster the user wants.
So we could have two arguments
raster_template_res
andraster_template_crop
for the user to define the name of the raster to be used as a basis for cropping and resolution.raster_template_crop
would be overridden byisofit
which could be relabelledisofit_crop
for clarity.The other arguments can stay as they are, but some of them will have to behave differently.
In particular,
aggregation_fn
andvalues_to_zero
should allow for users to define different input per raster layer.Not provided as a list, such arguments should work as they are now for a raster with a single layer or assume (at least for
aggregation_fn
but probably not forvalues_to_zero
) for the case of multiple layers that the same thing applies to all layer.The user should also be able to input named lists with names referring the raster layers to apply different setting on each layers.
aggregation_factor
should apply to the raster selected viaraster_template_res
.Proposal
I thus propose to revise the list of arguments as follows:
These changes will have to be coordinated with #154 but the current issue should probably be tackled first.
NB: this issue extends and thus replaces #124, #125, #141.
The text was updated successfully, but these errors were encountered: