R/read_collected_operators.R

#' Reads the file with the collected BEAST2 operators' acceptances
#' @param csv_filename name of the CSV file
#' @return a data frame with all operators' acceptances
#' @author Richel Bilderbeek
#' @usage read_collected_operators(
#'   csv_filename = wiritttea::find_path("read_collected_operators.csv"))
#' @export
read_collected_operators <- function(
  csv_filename = wiritttea::find_path("read_collected_operators.csv")
) {
  testit::assert(file.exists(csv_filename))
  df <- utils::read.csv(
    file = csv_filename,
    header = TRUE,
    stringsAsFactors = FALSE,
    row.names = 1
  )
  df$filename <- as.factor(df$filename)
  df$operator <- as.factor(df$operator)
  df

}
richelbilderbeek/wiritttea documentation built on May 27, 2019, 8:02 a.m.