Skip to content

Instantly share code, notes, and snippets.

@kevinrue
Created February 22, 2019 11:05
Show Gist options
  • Save kevinrue/b3f0076874dbb036ea9d2a1fa87db117 to your computer and use it in GitHub Desktop.
Save kevinrue/b3f0076874dbb036ea9d2a1fa87db117 to your computer and use it in GitHub Desktop.
Clone the content of an R package
clonePackageSource <- function(from, to, ignore=c(".git")) {
unisetRootFiles <- list.files(cloneSourceFolder, all.files = TRUE, include.dirs = TRUE)
unisetRootFiles <- setdiff(unisetRootFiles, c(".", "..", ".git"))
dir.create(cloneDestinationFolder, recursive = TRUE)
for (rootFile in unisetRootFiles) {
message(rootFile)
file.copy(
from = file.path(cloneSourceFolder, rootFile),
to = file.path(cloneDestinationFolder),
recursive = TRUE, overwrite = TRUE)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment