Skip to contents

This function launches a Shiny gadget within RStudio that allows users to manually update species data in a specified data frame. Only rows where the old species name differs from the new species name (or where the new species name is NA) are shown for selection and modification. Selecting a species from the dropdown filters the table to only show the selected row for updating. Once completed, the entire original data frame is returned with updated values in the specified column and an additional flag column.

Usage

update_name_app(data, old_names_col, new_names_col)

Arguments

data

A data frame containing species names and potentially other data.

old_names_col

The column name in the data frame corresponding to the old species names.

new_names_col

The column name in the data frame corresponding to the new species names to be updated.

Value

Returns the original data frame with the updated values in the new names column and a flag indicating whether each row was manually updated.

Examples

if (FALSE) { # \dontrun{
df <- data.frame(old_species = c("Chondostroma nasus", "Hucho ucho", "Anguila anguilla"),
                 new_species = c(NA, "Hucho ucho", NA), other_data = c(1, 2, 3))
updated_data <- update_name_app(df, "old_species", "new_species")
} # }