check_conf <- function(conf, file) {
  # conf: yaml user config already read it
  # file: name of the file to clarify messages
  message(paste("Checking user configuration", file))
  if (!('output_dir' %in% names(conf))) {
    stop(paste("The user configuration file should have element 'output_dir'."))
  }
  if (!is.character(conf$output_dir)) {
    stop (paste("The element 'output_dir' in", file,"file ",
          "should be a character string indicating the path ",
          "where to save the outputs."))
  }
  message("User configuration checked succsessfully.")
}

