Generate random points
Functions to generate random points within an animals home range. This is usually the first step for investigating habitat selection via Resource Selection Functions (RSF).
random_points(x, ...) ## S3 method for class 'hr' random_points(x, n = 100, type = "random", presence = NULL, ...) ## S3 method for class 'sf' random_points(x, n = 100, type = "random", presence = NULL, ...) ## S3 method for class 'SpatialPolygons' random_points(x, n = 100, type = "random", presence = NULL, ...) ## S3 method for class 'track_xy' random_points(x, level = 1, hr = "mcp", n = nrow(x) * 10, type = "random", ...)
x |
|
... |
|
n |
|
type |
|
presence |
|
level |
|
hr |
|
For objects of class track_xyt
the timestamp (t_
) is lost.
data(deer) # track_xyt --------------------------------------------------------------- # Default settings rp1 <- random_points(deer) ## Not run: plot(rp1) ## End(Not run) ## Not run: trast <- raster(bbox(deer, buffer = 5000), res = 30) rp3 <- random_points(deer, hr = "kde", trast = trast) # we need a larger template raster plot(rp3) ## End(Not run) # Only one random point for each observed point rp <- random_points(deer, factor = 1) ## Not run: plot(rp) ## End(Not run) # Within a home range ----------------------------------------------------- hr <- hr_mcp(deer, level = 1) # 100 random point within the home range rp <- random_points(hr, n = 100) ## Not run: plot(rp) ## End(Not run) # 100 regular point within the home range rp <- random_points(hr, n = 100, type = "regular") ## Not run: plot(rp) ## End(Not run) # 100 hexagonal point within the home range rp <- random_points(hr, n = 100, type = "hexagonal") ## Not run: plot(rp) ## End(Not run)
Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.