Skip to content

Instantly share code, notes, and snippets.

@t-student
Created May 17, 2018 06:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save t-student/a48df761ad54bda0bbba905fa0c0e7aa to your computer and use it in GitHub Desktop.
Save t-student/a48df761ad54bda0bbba905fa0c0e7aa to your computer and use it in GitHub Desktop.
tt <- tryCatch(hostmp <- read.config(file = "hosp.yaml"),
error=function(e) e,
warning=function(w) w)
ifelse(is(tt,"warning"),"Hospital Configuration Warning/Error.
Please ensure configuration file has terminating empty line.",
"Hospital Configuration OK")
hosplu <- data.frame(matrix("", ncol = 4, nrow = 0))
hosplu <- do.call(rbind, lapply(hostmp, data.frame, stringsAsFactors = F))
hosplu <- as.data.frame(apply(hosplu, 2, trim), stringsAsFactors = F)
hosplu <- as.data.frame(apply(hosplu, 2, as.character), stringsAsFactors = F)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment