bcgov / wqbench

R package to generate download and compile data from EPA ECOTOX database
Apache License 2.0
3 stars 2 forks source link

Update add data error message #26

Closed aylapear closed 1 year ago

aylapear commented 1 year ago

Add scripts have a line to throw an error if the data has already been added to the table. Currently it is wrapped up into a function that always creates a new database or skips these steps.

  if ("species_present_in_bc" %in% colnames(db_species)) {
    stop(
      "British Columbia species have already been added to the database"
    )
  }

In the future depending the design of the data creation this could be adjusted to overwrite the table by asking first. For now it needs to throw an error as it will error in the next steps due to names being duplicated when joined together