I wrote myself a project creation function which does what I like. I know there was one avaliable on CRAN but I hated it as it results in a number of useless folders. Here is mine:
Code:MyProject<- function (project.name = "Test", dir= c("libraries", "dataPrep", "data", "analysis", "graphics", "sweave", "workspace"), parent = getwd()){ #Function to create folders for project and to add sweave and example #.R files to appropriate folders #Create files copies example files from a general directory in the wd to new project #The copied files are specific to my concerns #In this version of the code they need to be saved in the same parent dir as #that specified in the MyProject function. #Eventually the files will be downloaded from the net. parent<- gsub('\\\\', '/', parent) dir.create(paste(parent, project.name, sep="/")) for (i in 1:length(dir)){ dir.create(paste(parent, project.name, dir[i], sep="/")) } CreateFiles() } CreateFiles<- function(){ #Files copied here are specific to my projects. #Some work needs to be done to make the function general to others. #e.g. Downloading sweave and example sweave files from online will be useful. for (i in 1:length(dir)) if(dir[i]=='sweave'){ download.file('http://www.biostat.jhsph.edu/~rpeng/ENAR2009/Sweave.sty', paste(parent, project.name, 'sweave', 'sweave.sty', sep='/')) }else{cat('No files copied for:', dir[i], '\n') } }





Reply With Quote