Skip to contents

Flags observations based on the 'confirm' column. If the '.observed' column does not exist, it is created. Observations are flagged as observed (TRUE) if 'confirm' is not NA.

Usage

enw_flag_observed_observations(obs, copy = TRUE)

Arguments

obs

A data.frame with at least a have confirm column.

copy

A logical; if TRUE (the default) creates a copy; otherwise, modifies obs in place.

Value

A data.table with an additional column '.observed' indicating observed observations.

Examples

dt <- data.frame(id = 1:3, confirm = c(NA, 1, 2))
enw_flag_observed_observations(dt)
#>       id confirm .observed
#>    <int>   <num>    <lgcl>
#> 1:     1      NA     FALSE
#> 2:     2       1      TRUE
#> 3:     3       2      TRUE