Description Usage Arguments Details Examples
run ecocrop for all cells in a passed raster stack for the specified crop
1 2 3 |
crop |
the crop either a name or ecocrop object |
st_clim_all |
single raster stack containing all climate inputs (see data(st_clim)) |
st_tmin |
min temp by month in a raster stack |
st_tavg |
mean temp by month in a raster stack |
st_prec |
precipitation by month in a raster stack |
rainfed |
default TRUE |
filename |
optional output file |
simpler |
trial of simpler suitability calc, done via cr_suit_simpler() |
diagnostic |
whether to output suitabilities by the different attributes |
... |
extra parameters to pass to writeRaster |
based on code from run_ecocrop() by Adam Sparks CURRENTLY USES dismo::ecocrop() function, we may wish to refactor this to give us more control over
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | #subset climate data to make faster run
st_clim2 <- raster::crop(st_clim, extent(-10,10,0,60))
rast_potato_suit2 <- ecocrop_a_raster('potato',st_clim2,simpler=TRUE)
plot(rast_potato_suit2)
#world takes a few mins to run
#rast_potato_suit <- ecocrop_a_raster('potato',st_clim)
#st_potato_suit <- ecocrop_a_raster('potato',st_clim, simpler=TRUE, diagnostic=TRUE)
#st_maize_suit <- ecocrop_a_raster('maize',st_clim, simpler=TRUE, diagnostic=TRUE)
#subset climate data to make faster run, here testing simpler method on maize
#st_clim2 <- raster::crop(st_clim, extent(-10,10,0,60))
#rast_maize_suit2 <- ecocrop_a_raster('maize',st_clim2,simpler=TRUE, diagnostic=FALSE)
#rast_potato_suit <- ecocrop_a_raster('potato',st_clim,simpler=TRUE, diagnostic=FALSE)
#to use climate tmax rather than tavg
#wheat_tmax <- ecocrop_a_raster('wheat', st_clim2, simpler=TRUE, use_tmax=TRUE)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.