View source: R/explore_blocks.R
explore_blocks_pre | R Documentation |
Function to explore the number of cases and observations for the different sampling units possibly used as the base H0 hierarchical level, such as population ID, study area, animal ID, or year, before spatial stratification or creating samples for the bootstrapped approach. The function can help understand how imbalanced is the data across H0 levels used for validation.
explore_blocks_pre(data, colH0, animal_id = NULL, col_case = "case")
data |
|
colH0 |
|
animal_id |
|
col_case |
|
# read data
data("reindeer_ssf")
# explore blocks - animal ID as block H0
explore_blocks_pre(reindeer_ssf, "original_animal_id", col_case = "case_")
# explore blocks - year as block H0
library(lubridate)
reindeer_ssf |>
dplyr::mutate(year = lubridate::year(t1_)) |>
explore_blocks_pre("year", col_case = "case_")
# year as block H0 + animal ID
reindeer_ssf |>
dplyr::mutate(year = lubridate::year(t1_)) |>
explore_blocks_pre("year", animal_id = "original_animal_id", col_case = "case_")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.