zipLocalRepo and zipRemoteRepo create a zip archive from an existing Repository. zipLocalRepo zips local Repository, zipRemoteRepo zips Repository stored on Github.

zipLocalRepo(repoDir = aoptions("repoDir"), repoTo = getwd(),
  zipname = "repository.zip")

zipRemoteRepo(repoTo = getwd(), user = aoptions("user"),
  repo = aoptions("repo"), branch = "master",
  subdir = aoptions("subdir"), repoType = aoptions("repoType"),
  zipname = "repository.zip")

Arguments

repoDir

A character that specifies the directory of the Repository which will be zipped.

repoTo

A character that specifies the directory in which there will be created zip archive from Repository stored in repoDir or Remote directory. By default set to working directory (getwd()).

zipname

A character that specifies name of the zipped repository. It is assumed that this file does not exist or does not contain backpack.db file. An attempt to override will produce an error.

user

While working with the Remote repository. A character containing a name of the Remote user on whose account the repo is created. By default set to NULL - see Note.

repo

While working with the Remote repository. A character containing a name of the Remote repository on which the Repository, which is to be zipped, is archived. By default set to NULL - see Note.

branch

While working with the Remote repository. A character containing a name of the Remote repository's branch on which Repository, which is to be zipped, is archived. Default branch is master.

subdir

While working with a Remote repository. A character containing a name of a directory on Remote repository on which the Repository, which is to be zipped, is stored. If the Repository is stored in the main folder on the Remote repository, this should be set to FALSE as default.

repoType

A character containing a type of the remote repository. Currently it can be 'Remote' or 'bitbucket'.

Note

The function might not work if Rtools are not installed. To solve this problem follow these Instructions.

If repo and user are set to NULL (as default) in Github mode then global parameters set in setRemoteRepo function are used.

Contact

Bug reports and feature requests can be sent to https://github.com/pbiecek/archivist/issues

References

Biecek P and Kosinski M (2017). "archivist: An R Package for Managing, Recording and Restoring Data Analysis Results." _Journal of Statistical Software_, *82*(11), pp. 1-28. doi: 10.18637/jss.v082.i11 (URL: http://doi.org/10.18637/jss.v082.i11). URL https://github.com/pbiecek/archivist

See also

Examples

# objects preparation
# NOT RUN { # data.frame object data(iris) # ggplot/gg object library(ggplot2) df <- data.frame(gp = factor(rep(letters[1:3], each = 10)),y = rnorm(30)) library(plyr) ds <- ddply(df, .(gp), summarise, mean = mean(y), sd = sd(y)) myplot123 <- ggplot(df, aes(x = gp, y = y)) + geom_point() + geom_point(data = ds, aes(y = mean), colour = 'red', size = 3) # lm object model <- lm(Sepal.Length~ Sepal.Width + Petal.Length + Petal.Width, data= iris) # Local version exampleRepoDir <- tempfile() createLocalRepo( repoDir = exampleRepoDir ) saveToLocalRepo( myplot123, repoDir=exampleRepoDir ) saveToLocalRepo( iris, repoDir=exampleRepoDir ) saveToLocalRepo( model, repoDir=exampleRepoDir ) zipLocalRepo( exampleRepoDir ) deleteLocalRepo( exampleRepoDir, TRUE) rm( exampleRepoDir ) # Remote version zipRemoteRepo( user="MarcinKosinski", repo="Museum", branch="master", subdir="ex1" ) zipRemoteRepo( user="pbiecek", repo="archivist", repoTo = getwd( ) ) # }