R/add_info.R

#' Add a readme file to the project
#'
#' Function to create a file README.md.
#'
#' @param path The path to the main folder of the project
#' @param desc The name of the project
#'
#' @return NULL invisibly
#'
#' @export
#'
add_readme <- function(path, desc){

  header <- c(paste0("## ", desc), "\n")

  body <- c(
    "This project contains the following folders:",
    "", # empty line
    " * **Data**: raw data files.",
    " * **Data_Processed**: processed data files.",
    " * **Functions**: functions used in the project.",
    " * **Graphs**: all plots generated by the scripts.",
    " * **Reports**: Reports in Rmarkdown.",
    "", # empty line
    "<--- Here you can give a short summary of the project --->"
  )

  writeLines(c(header, body),
             con = file.path(path,"README.md"))
}
JoFAM/daprojects documentation built on May 13, 2019, 8:19 a.m.