R/mergeDocumentation.R

Defines functions .doc_merge

.doc_merge <- function(old, new) {
  merged <- list()
  oldnames <- names(old)
  newnames <- names(new)
  for (i in oldnames) {
    if (i %in% newnames) {
      merged[[i]] <- new[[i]]
    } else {
      merged[[i]] <- old[[i]]
    }
  }
  for (i in newnames) {
    if (!i %in% oldnames) {
      merged[[i]] <- new[[i]]
    }
  }
  return(merged)
}

Try the DataPackageR package in your browser

Any scripts or data that you put into this service are public.

DataPackageR documentation built on Sept. 18, 2024, 1:07 a.m.