R/write_tibble_to_csv.R

Defines functions write_tibble_to_csv

Documented in write_tibble_to_csv

#' @title
#'   Helper function to write tibble to a .CSV file
#'
#' @description
#'   The \code{write_tibble_to_csv()} writes a tibble to a .CSV file.
#'
#' @param timber
#'   A tibble of timber.
#'
#' @param mill_step
#'   Numeric: the value of the Haldane correction to apply; must be > 0.
#'
#' @return
#'   The path of the saved .CSV file in the 'test_check' folder.
#'
#' @importFrom readr write_csv
#'
#' @export

write_tibble_to_csv <- function(timber, mill_step) {
  path <- paste0(
    mill_step,
    ".csv"
  )
  readr::write_csv(timber, path)

  return(path)
}
iAM-AMR/sawmill documentation built on June 30, 2024, 2:25 a.m.