TheTS / palmsplusr

palmsplusr: PALMS post-processing
http:/thets.github.io/palmsplusr/
GNU Lesser General Public License v3.0
5 stars 1 forks source link

Check if fields already exist in table before appending #1

Closed TheTS closed 6 years ago

TheTS commented 6 years ago

In all of these functions

palms_add_field <- function(name, formula, domain_field = FALSE) {
  if (!exists("palmsplus_fields"))
    palmsplus_fields <<- tibble(name = name, formula = formula, domain_field = domain_field)
  else
    palmsplus_fields <<- rbind(palmsplus_fields, c(name, formula, domain_field))
}