R/tree_priors_to_xml_distr.R

Defines functions tree_priors_to_xml_prior_distr

Documented in tree_priors_to_xml_prior_distr

#' Creates the distribution section in the prior section of the
#' distribution section of a BEAST2 XML parameter file.
#'
#' These lines start with '<distribution id='
#' @inheritParams default_params_doc
#' @return lines of XML text
#' @examples
#' check_empty_beautier_folder()
#'
#'  # <distribution id="posterior" spec="util.CompoundDistribution">
#'  #     <distribution id="prior" spec="util.CompoundDistribution">
#'  #       HERE, where the ID of the distribution is 'prior'
#'  #     </distribution>
#'  #     <distribution id="likelihood" ...>
#'  #     </distribution>
#'  # </distribution>
#'
#' check_empty_beautier_folder()
#' @author Richèl J.C. Bilderbeek
#' @export
tree_priors_to_xml_prior_distr <- function(
  tree_priors,
  beauti_options
) {
  check_true(are_tree_priors(tree_priors))

  text <- NULL
  for (tree_prior in tree_priors) {
    text <- c(
      text,
      tree_prior_to_xml_prior_distr(
        tree_prior,
        beauti_options = beauti_options
      )
    )
  }
  text
}
richelbilderbeek/beautier documentation built on April 4, 2024, 12:33 p.m.