View source: R/translate_raster.R
translate_raster | R Documentation |
Torus translation
translate_raster(
raster,
steps_x = NULL,
steps_y = NULL,
return_input = TRUE,
simplify = FALSE,
verbose = TRUE
)
raster |
SpatRaster with discrete habitat classes. |
steps_x , steps_y |
Integer with number of steps (cells) the raster is translated into the corresponding direction. If both are null, all possible combinations are used resulting in n = ((50 + 1) * (50 + 1)) - 4 rasters. |
return_input |
Logical if the original input data is returned. |
simplify |
Logical if only the raster will be returned if |
verbose |
Logical if progress report is printed. |
Torus translation test as described in Harms et al. (2001). The raster is shifted in all four cardinal directions by steps equal to the raster resolution. If a cell exits the extent on one side, it enters the extent on the opposite side.
The method does not allow any NA values to be present in the SpatRaster.
rd_ras
Harms, K.E., Condit, R., Hubbell, S.P., Foster, R.B., 2001. Habitat associations of trees and shrubs in a 50-ha neotropical forest plot. Journal of Ecology 89, 947–959. <https://doi.org/10.1111/j.1365-2745.2001.00615.x>
randomize_raster
## Not run:
landscape_classified <- classify_habitats(terra::rast(landscape), n = 5, style = "fisher")
landscape_random <- translate_raster(landscape_classified)
landscape_random_sub <- translate_raster(landscape_classified,
steps_x = 1:10, steps_y = 1:5)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.