R/go_through_table_transformations.R

Defines functions go_through_table_transformations

Documented in go_through_table_transformations

#' @title Extract transformations to apply
#' 
#' @description Reading the column corresponding to the transformations to apply, this function adds them into the .R script.
#' 
#' @author Briac LE RAY (briac.leray@partnre.com)
#' 
#' @return Does not return anything. Writes in a file.
#' @param merging_table The filled merging template. Type = dataframe
#' @param file_path The file to the path to write the code in. Type = character
#' @examples go_through_table_transformations(merging_table = my_filled_template, file_path = "path/to/the/file/file_name.extension")

go_through_table_transformations <- function(merging_table, file_path) {
  for (i in 1:nrow(merging_table)) {
    row = merging_table[i,]
    if(!is.na(row[["Modifications_a_apporter"]])) {
      add_to_file(text = row[["Modifications_a_apporter"]], file_path = file_path)
    }
  }
}
Tiipiac/StressTestOptimization documentation built on Dec. 18, 2021, 5:08 p.m.