
Build a manual-override table from review decisions
Source:R/build-review-overrides.R
build_review_overrides.RdTurns a set of per-record review decisions (accept / reject / relocate) into
a completed override table with the same layout write_geocode_review()
produces, so it can be written to CSV and fed straight to
apply_manual_overrides(). This is the testable core behind the map-based
review app (run_locatr_review_app()); it holds no reactive or UI code, so
it can also be used headless.
Value
A tibble with record_id, record_name, full_address_clean,
the current latitude/longitude, the reviewer's manual_latitude /
manual_longitude, and manual_note. Compatible with
apply_manual_overrides().
Details
Decision semantics:
accept- confirm the automated coordinate:manual_latitude/manual_longitudeare set to the record's current coordinate.relocate- use the reviewer's coordinate:manual_latitude/manual_longitudecome from thedecisionstable.reject- drop the coordinate:manual_*are leftNA(soapply_manual_overrides()does not place it) and the note records the rejection.
Examples
geocoded <- data.frame(
record_id = c("a", "b", "c"),
record_name = c("A", "B", "C"),
full_address_clean = c("1 A St", "2 B St", "3 C St"),
latitude = c(40.1, 40.2, NA),
longitude = c(-74.1, -74.2, NA)
)
decisions <- data.frame(
record_id = c("a", "b", "c"),
decision = c("accept", "relocate", "reject"),
manual_latitude = c(NA, 40.25, NA),
manual_longitude = c(NA, -74.25, NA)
)
build_review_overrides(geocoded, decisions)
#> # A tibble: 3 × 8
#> record_id record_name full_address_clean latitude longitude manual_latitude
#> <chr> <chr> <chr> <dbl> <dbl> <dbl>
#> 1 a A 1 A St 40.1 -74.1 40.1
#> 2 b B 2 B St 40.2 -74.2 40.2
#> 3 c C 3 C St NA NA NA
#> # ℹ 2 more variables: manual_longitude <dbl>, manual_note <chr>