Based on a compressed and filtered capture history, translate into a capture history matrix.

buildCapHist(
  filter_ch = NULL,
  parent_child = NULL,
  configuration = NULL,
  keep_cols = c("tag_code"),
  drop_nodes = T,
  ...
)

Arguments

filter_ch

filtered capture history as returned by the `filterDetections()` function, which has then been verified by a user and all blank or NA `user_keep_obs` entries have been completed.

parent_child

parent-child table. Could be created from `buildParentChild()` from `PITcleanr` package.

configuration

configuration file. Could be created from `buildConfig()` from `PITcleanr` package.

keep_cols

what columns from `filter_ch` should be kept in the final output. These should be columns that are consistent for each tag. Default value is `tag_code`.

drop_nodes

After constructing a capture history with one row per tag, should the various columns containing specific node detections be dropped (`TRUE`) or retained (`FALSE`).

...

other inputs to the `defineCapHistCols` if desired.

Value

A tibble or data.frame with one row per tag, containing at least a column called `cap_hist` where each entry is a string of 0s and 1s corresponding to whether that tag was detected at each node or not. The order of the columns is determined by `defineCapHistCols`, and the user can input arguments to that function here.

Author

Kevin See

Examples

buildConfig()
#> Querying INT sites' metadata
#> Querying INT sites' configuration information
#> Querying MRR sites' metadata
#> # A tibble: 7,571 × 15
#>    site_code config_id antenna_id node  start_date          end_date           
#>    <chr>         <dbl> <chr>      <chr> <dttm>              <dttm>             
#>  1 0HR             100 01         0HR   2022-07-26 00:00:00 NA                 
#>  2 0HR             100 02         0HR   2022-07-26 00:00:00 NA                 
#>  3 0HR             100 03         0HR   2022-07-26 00:00:00 NA                 
#>  4 158             100 D1         158_U 2011-11-29 00:00:00 NA                 
#>  5 158             100 D2         158_U 2011-11-29 00:00:00 NA                 
#>  6 158             100 D3         158_D 2011-11-29 00:00:00 NA                 
#>  7 158             100 D4         158_U 2011-11-29 00:00:00 NA                 
#>  8 158             100 D5         158_U 2011-11-29 00:00:00 NA                 
#>  9 158             100 D6         158_D 2011-11-29 00:00:00 NA                 
#> 10 15D             100 C1         15D_U 2012-03-15 00:00:00 2019-06-30 12:00:00
#> # ℹ 7,561 more rows
#> # ℹ 9 more variables: site_type <chr>, site_name <chr>, antenna_group <chr>,
#> #   site_description <chr>, site_type_name <chr>, rkm <chr>, rkm_total <dbl>,
#> #   latitude <dbl>, longitude <dbl>