R/add_element_names_to_chapter_structure.R

Defines functions add_chunk_templates_to_chapter_structure

add_chunk_templates_to_chapter_structure <-
  function(chapter_structure, chunk_templates) {

  out <- vctrs::vec_slice(chapter_structure,
                          !is.na(chapter_structure$.variable_name_dep))
  out <- tidyr::crossing(out, chunk_templates)
  out_na <- vctrs::vec_slice(chapter_structure,
                             is.na(chapter_structure$.variable_name_dep))

  out <- dplyr::bind_rows(out_na, out)
  out
}

Try the saros.base package in your browser

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

saros.base documentation built on June 8, 2025, 10:03 a.m.