R/convertToListEntry.R

Defines functions convertToListEntry

Documented in convertToListEntry

#' Take a line from a genParam parameter file and turns it into a list element
#'
#' Take a line from a genParam parameter file and turns it into a list element
#'
#' @param line a line from a parameter file
#' @return list selement 

convertToListEntry <- function(line){
    first.pattern <- "\\{.*\\}\\{"
    m <- regexpr(first.pattern, line)
    key <- gsub("[}{]", "", regmatches(line, m))

    second.pattern <- "\\}\\{.*\\}"
    m <- regexpr(second.pattern, line)
    value <- gsub("[}{]", "", regmatches(line, m))
    l = list()
    l[key] = value
    l 
}
johnjosephhorton/JJHmisc documentation built on May 19, 2019, 5:15 p.m.