Projects/makeProj.R

makeProj <- function(){
  setwd(choose.dir())
  workdir <- getwd()
  if(!file.exists("./Data")) system("mkdir ./Data") ##have to manually copy data to Data folder? 
  if(!file.exists("./Documents")) system("mkdir ./Documents")
  if(!file.exists("./Figures")) system("mkdir ./Figures")
  if(!file.exists("./Tables")) system("mkdir ./Tables")
  projname <- strsplit(basename(workdir), "_|\ ")[[1]][1]
  dist_folder <- paste(projname, "distributed", sep="_")
  if(!file.exists(paste0("./",dist_folder))) system(paste0("mkdir ./",dist_folder))
  dist_folder <- paste(workdir, dist_folder,sep="/")
  rmarkdown::render("./Rmarkdown_report.Rmd",  output_format = "word_document",output_dir=dist_folder)
  print("copy 1 is done!")
  rmarkdown::render("./Rmarkdown_report.Rmd",  output_format = "word_document")
  print("copy 2 id done!")
}


makeProj()
rocrat/HTGPackage documentation built on May 25, 2017, 8:32 a.m.