View source: R/simulate_site_data.R
simulate_site_data | R Documentation |
Simulate site data for developing simulated survey schemes.
simulate_site_data(
n_sites,
n_features,
proportion_of_sites_missing_data,
n_env_vars = 3,
survey_cost_intensity = 20,
survey_cost_scale = 5,
management_cost_intensity = 100,
management_cost_scale = 30,
max_number_surveys_per_site = 5,
output_probabilities = TRUE
)
n_sites |
|
n_features |
|
proportion_of_sites_missing_data |
|
n_env_vars |
|
survey_cost_intensity |
|
survey_cost_scale |
|
management_cost_intensity |
|
management_cost_scale |
|
max_number_surveys_per_site |
|
output_probabilities |
|
A sf::sf()
object with site data.
The "management_cost"
column contains the site protection costs,
and the "survey_cost"
column contains the costs for surveying
each site.
Additionally, columns that start with
(i) "f"
(e.g. "f1"
) contain the proportion of
times that each feature was detected in each site,
(ii) "n"
(e.g. "n1"
) contain the number of
of surveys for each feature within each site,
(iii) "p"
(e.g. "p1"
) contain prior
probability data, and
(iv) "e"
(e.g. "e1"
) contain environmental
data. Note that columns that contain the same integer value (excepting
environmental data columns) correspond to the same feature
(e.g. "d1"
, "n1"
, "p1"
contain data that correspond
to the same feature).
simulate_feature_data()
# set seed for reproducibility
set.seed(123)
# simulate data
d <- simulate_site_data(n_sites = 10, n_features = 4, prop = 0.5)
# print data
print(d, width = Inf)
# plot cost data
plot(d[, c("survey_cost", "management_cost")], axes = TRUE, pch = 16,
cex = 2)
# plot environmental data
plot(d[, c("e1", "e2", "e3")], axes = TRUE, pch = 16, cex = 2)
# plot feature detection data
plot(d[, c("f1", "f2", "f3", "f4")], axes = TRUE, pch = 16, cex = 2)
# plot feature survey effort
plot(d[, c("n1", "n2", "n3", "n4")], axes = TRUE, pch = 16, cex = 2)
# plot feature prior probability data
plot(d[, c("p1", "p2", "p3", "p4")], axes = TRUE, pch = 16, cex = 2)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.