View source: R/random_points.R
random_points | R Documentation |
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 'track_xy'
random_points(x, level = 1, hr = "mcp", n = nrow(x) * 10, type = "random", ...)
x |
|
... |
|
n |
|
type |
|
presence |
|
level |
|
hr |
|
A tibble
with the observed and random points and a new column case_
that indicates if a point is observed (case_ = TRUE
) or random (case_ TRUE
).
For objects of class track_xyt
the timestamp (t_
) is lost.
data(deer)
# track_xyt ---------------------------------------------------------------
# Default settings
rp1 <- random_points(deer)
plot(rp1)
# Ten random points for each observed point
rp <- random_points(deer, n = nrow(deer) * 10)
plot(rp)
# Within a home range -----------------------------------------------------
hr <- hr_mcp(deer, level = 1)
# 100 random point within the home range
rp <- random_points(hr, n = 100)
plot(rp)
# 100 regular point within the home range
rp <- random_points(hr, n = 100, type = "regular")
plot(rp)
# 100 hexagonal point within the home range
rp <- random_points(hr, n = 100, type = "hexagonal")
plot(rp)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.