R/strict_clock_model_to_xml_tracelog.R

Defines functions strict_clock_model_to_xml_tracelog

Documented in strict_clock_model_to_xml_tracelog

#' Internal function
#'
#' Creates a strict clock model's XML for the tracelog section
#' @inheritParams default_params_doc
#' @return a character vector of XML strings
#' @examples
#' check_empty_beautier_folder()
#'
#' # <logger id="tracelog" ...>
#' #'   # Here
#' # </logger>
#'
#' check_empty_beautier_folder()
#' @author Richèl J.C. Bilderbeek
#' @export
strict_clock_model_to_xml_tracelog <- function( # nolint indeed a long internal function name
  inference_model
) {
  check_true(
    is_strict_clock_model(inference_model$clock_model)
  )
  clock_model <- inference_model$clock_model
  id <- clock_model$id
  check_true(is_id(id))
  text <- NULL
  if (clock_model$clock_rate_param$estimate) {
    text <- c(
      text,
      paste0("<log idref=\"clockRate.c:", id, "\"/>")
    )
  }
  text
}

Try the beautier package in your browser

Any scripts or data that you put into this service are public.

beautier documentation built on Nov. 2, 2023, 5:08 p.m.