R/get_HDR_name.R

Defines functions get_HDR_name

Documented in get_HDR_name

#' get hdr name from image file name
#'
#' @param ImPath character. ath of the image
#' @param showWarnings boolean. set TRUE if warning because HDR does not exist
#'
#' @return corresponding hdr
#' @import tools
#' @export

get_HDR_name <- function(ImPath,showWarnings=TRUE) {
  ImPathHDR <- paste0(file_path_sans_ext(ImPath), ".hdr")
  if (showWarnings==TRUE){
    if (!file.exists(ImPathHDR)) print_error_message(def_error = 'missing_hdr',
                                                     optarg = ImPathHDR)
  }
  return(ImPathHDR)
}
jbferet/biodivMapR documentation built on April 12, 2025, 1:32 p.m.