
Launch the Data Update App
launch_data_update_app.RdLaunches an interactive Shiny app for correcting plot metadata and individual
data one record at a time. It is the user-friendly counterpart to
update_records, which is powerful but expects the caller to
already know which table a value lives in.
Details
The app has two sections:
Plot metadata - pick a plot, edit the columns stored directly in
data_liste_plots(including themethodandcountrylookups, offered as dropdowns), and edit its features.Individual data - find an individual by plot and tag or by
id_n, edit the columns ofdata_individuals, change its identification through an embedded taxonomic search, and edit its trait measurements.
Why features need care. Many columns of an extracted plot or
individual table are not columns of that record at all. Plot features are
rows of data_liste_sub_plots; individual features are rows of
data_traits_measures. Worse, one extracted column can be the
aggregate of several such rows - the mean of a trait measured at
three censuses, or the concatenated names of everyone recorded as
additional_people. Writing back to that single value is meaningless,
which is why update_records() refuses it.
The app therefore never edits an aggregate. For every feature it shows how many records back it, what the extracted table would display, and how that display was computed; the editable inputs are the underlying records, each labelled with its own id and its census or subplot context.
Why an identification is not just idtax_n.
merge_individuals_taxa() resolves the individual's idtax_n
through table_idtax synonymy into idtax_f, resolves the
identification of the specimen linked to the individual the same way into
idtax_specimen_f, and uses
idtax_individual_f = coalesce(idtax_specimen_f, idtax_f) everywhere
downstream. The identification section shows that whole cascade. While a
specimen is linked, its identification wins: editing idtax_n is
stored but changes nothing an extraction shows, and the app says so both in
the section and in the preview. Re-identifying the specimen is done with
launch_specimen_identification_app.
Only existing records can be edited. Adding or deleting measurements is done
with the feature wizard (launch_feature_wizard) and the
safe_delete_* functions.
Every write goes through detect_direct_changes() and
execute_direct_updates(), so stored values are re-read immediately
before writing, only genuine differences are written, and records are backed
up to their follow-up table where one exists.