R/get_output_meta.R

Defines functions get_output_meta

Documented in get_output_meta

#' Helper Function: Get Metadata of Outputs ('A_LEVEL.out', 'T_LEVEL.out')
#'
#' @param output imported output as retrieved by \code{read_alevel} or \code{read_tlevel}
#'
#' @return returns metainformation list with sublists "general" and "units"  of
#' imported 'A_LEVEL.out' or 'T_LEVEL.out' file
#' @export
#' @examples
#' test_file <- function(x) system.file("extdata/model/test", x, package = "kwb.hydrus1d")
#' alevel <- read_alevel(path = test_file("A_LEVEL.out"))
#' get_output_meta(alevel)
#' tlevel <- read_tlevel(path = test_file("T_LEVEL.out"))
#' get_output_meta(tlevel)
get_output_meta <- function(output) {
  list(
    general = attr(output, "meta_general"),
    units = attr(output, "meta_units")
  )
}
KWB-R/kwb.hydrus1d documentation built on Nov. 21, 2022, 4:54 a.m.