archivist (version 1.2)

zipLocalRepo: Create a zip Archive From an Existing Repository

Description

zipLocalRepo and zipGithubRepo create a zip archive from an existing Repository.

If the function does not work, it might be a reason of Rtools that are not installed. To solve this problem follow those http://cran.r-project.org/web/packages/openxlsx/vignettes/Introduction.pdf{Instructions.}

Usage

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

zipGithubRepo(repoTo = getwd(), user, repo, branch = "master", repoDirGit = FALSE, 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 will be created zip archive from Repository stored in repoDir or Github directory. By default set to working directory (getwd())/
zipname
A character that specifies name of 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
Only if working with a Github repository. A character containing a name of a Github user on whose account the repo is created.
repo
Only if working with a Github repository. A character containing a name of a Github repository on which the Repository to be zipped is archived.
branch
Only if working with a Github repository. A character containing a name of Github repository's branch in which Repository to be zipped is archived. Default branch is master.
repoDirGit
Only if working with a Github repository. A character containing a name of a directory on Github repository on which the Repository to be zipped is stored. If the Repository is stored in main folder on Github repository, this should be set to

Details

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

See Also

Other archivist: Repository; Tags; addTagsRepo; archivist-package; cache; copyGithubRepo, copyLocalRepo; createEmptyRepo; deleteRepo; getTagsGithub, getTagsLocal; loadFromGithubRepo, loadFromLocalRepo; md5hash; multiSearchInGithubRepo, multiSearchInLocalRepo, searchInGithubRepo, searchInLocalRepo; rmFromRepo; saveToRepo; shinySearchInLocalRepo; showGithubRepo, showLocalRepo; summaryGithubRepo, summaryLocalRepo

Other archivist: Repository; Tags; addTagsRepo; archivist-package; cache; copyGithubRepo, copyLocalRepo; createEmptyRepo; deleteRepo; getTagsGithub, getTagsLocal; loadFromGithubRepo, loadFromLocalRepo; md5hash; multiSearchInGithubRepo, multiSearchInLocalRepo, searchInGithubRepo, searchInLocalRepo; rmFromRepo; saveToRepo; shinySearchInLocalRepo; showGithubRepo, showLocalRepo; summaryGithubRepo, summaryLocalRepo

Examples

Run this code
# objects preparation
# 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 <- tempdir()
createEmptyRepo( repoDir = exampleRepoDir )
saveToRepo( myplot123, repoDir=exampleRepoDir )
saveToRepo( iris, repoDir=exampleRepoDir )
saveToRepo( model, repoDir=exampleRepoDir )



zipLocalRepo( exampleRepoDir )

deleteRepo( exampleRepoDir )

rm( exampleRepoDir )

# Github version

zipGithubRepo( user="MarcinKosinski",
repo="Museum", branch="master", repoDirGit="ex1" )

zipGithubRepo( user="pbiecek", repo="archivist", repoTo = getwd( ) )

Run the code above in your browser using DataLab