make_user_mapping: Generate a WAStD user mapping from a given list of ODKC data.

View source: R/make_user_mapping.R

make_user_mappingR Documentation

Generate a WAStD user mapping from a given list of ODKC data.

Description

The matching is done by fuzzyjoin::stringdist_left_join using the Jaro-Winker distance between the ODKC username and the individual WAStD name, username and aliases of current active WAStD Users.

Usage

make_user_mapping(
  odkc_data,
  wastd_users,
  verbose = wastdr::get_wastdr_verbose()
)

Arguments

odkc_data

The output of wastdr::download_all_odkc_turtledata_2019.

wastd_users

A tibble of WAStD users

verbose

Whether to show debug messages. Default: wastdr::get_wastdr_verbose()

Details

The field aliases is where the magic happens. make_user_mapping matches against each alias after separating the aliases by comma. This way, we can add the exact misspelling of an ODK Collect username as a new alias, and get a 100% match for it.

Extract all unique reporter names from odkc data. Extract relevant user names from WAStD users. Map most likely match and export to CSV. External QA: review mapping, update WAStD user aliases to improve the user matching process. Re-run until optimized, edit CSV to improve match. Return a named list containing the mapping of odkc_reporter and wastd_user_id.


dbca-wa/etlTurtleNesting documentation built on Nov. 18, 2022, 8:03 a.m.