From b25ba5eb46255a9e5e453eaa4821847d30096663 Mon Sep 17 00:00:00 2001 From: Christiaan Pauw Date: Mon, 31 May 2021 12:28:40 +0200 Subject: [PATCH] Create writeText.R Convenience function to write results of other functions that create sections or subsections to a text file --- R/writeText.R | 11 +++++++++++ 1 file changed, 11 insertions(+) create mode 100644 R/writeText.R diff --git a/R/writeText.R b/R/writeText.R new file mode 100644 index 0000000..d7167e4 --- /dev/null +++ b/R/writeText.R @@ -0,0 +1,11 @@ +#' @title writeText +#' @description Write result (like those of of makeSRCPARAMtext) to a text file +#' @param path Character. Filepath and filename +#' @param inp_text Character. Result of makeSRCPARAMtext or similar +#' @export + +writeText <- function(inp_text, path){ + con <- file(path) + writeLines(inp_text, con) + close(con) +}