R/convert.header.R

convert.header <- function(header1, header2){

  names(header1) <- toupper(header1)
  names(header2) <- toupper(header2)

  hd1 <- names(header1)
  hd2 <- names(header2)
  if(any(duplicated(hd1))){
    return(header1)
  }

  id <- which(hd1 %in% hd2)
  if(length(id) == 0){
    return(header1)
  }

  hd <- hd1[id]
  header1[id] <- header2[hd]
  header1

}

Try the SCAT package in your browser

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

SCAT documentation built on May 2, 2019, 1:24 p.m.