Created
June 17, 2019 05:15
-
-
Save ymattu/dfb7a0ee48ff8d479630df36334addcc to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
createProject <- function(dir) { | |
path <- file.path(dir, paste0(basename(dir), ".Rproj")) | |
template_path <- system.file("templates/template.Rproj", | |
package = "devtools") | |
x <- c("Version: 1.0", "", "RestoreWorkspace: Default", "SaveWorkspace: Default", | |
"AlwaysSaveHistory: Default", "", "EnableCodeIndexing: Yes", | |
"UseSpacesForTab: Yes", "NumSpacesForTab: 4", "Encoding: UTF-8", | |
"", "RnwWeave: knitr", "LaTeX: pdfLaTeX") | |
cat(paste(x, collapse="\n"), file=template_path) | |
file.copy(template_path, path) | |
message(path, " has been created") | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment