R/adiCon.R

Defines functions adiCon

Documented in adiCon

#' @title adiCon
#' @description Function used to deparse a line of ADIF 2 called by readAdi.
#' @export
adiCon <- function(adiLine){ 
  adiData <- str_match_all(adiLine, ">(.*?)<")
  
  adiHeader <- str_match_all(adiLine, "<(.*?)>")
  
  dfx <- data.frame(t(adiData[[1]][,2]))
  nameCols <- adiHeader[[1]][,2]
  nameCols <- gsub(":.*", "", nameCols)
  names(dfx) <- nameCols[nameCols != "EOR"]
  dfx
}
YoJimboDurant/rHamr documentation built on April 8, 2020, 2:58 p.m.