Learn R Programming

archivist (version 1.6)

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 = NULL, repoTo = getwd(), zipname = "repository.zip")

zipGithubRepo(repoTo = getwd(), user = NULL, repo = NULL, branch = "master", repoDirGit = FALSE, zipname = "repository.zip")

Arguments

repoDir
A character that specifies the directory of the Repository which will be zipped. If set to NULL (by default), uses the repoDir specified in setLocalRepo.
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. By default set to NULL - see Note.
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. By default set to NULL - see Note.
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 repoDi

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; %a%; addTagsRepo; ahistory, print.ahistory; aoptions; archivist-package; aread; asearch; cache; copyGithubRepo, copyLocalRepo; createEmptyRepo; deleteRepo; getTagsGithub, getTagsLocal; loadFromGithubRepo, loadFromLocalRepo; md5hash; multiSearchInGithubRepo, multiSearchInLocalRepo, searchInGithubRepo, searchInLocalRepo; rmFromRepo; saveSetToRepo; saveToRepo; setGithubRepo, setLocalRepo; shinySearchInLocalRepo; showGithubRepo, showLocalRepo; summaryGithubRepo, summaryLocalRepo

Other archivist: Repository; Tags; %a%; addTagsRepo; ahistory, print.ahistory; aoptions; archivist-package; aread; asearch; cache; copyGithubRepo, copyLocalRepo; createEmptyRepo; deleteRepo; getTagsGithub, getTagsLocal; loadFromGithubRepo, loadFromLocalRepo; md5hash; multiSearchInGithubRepo, multiSearchInLocalRepo, searchInGithubRepo, searchInLocalRepo; rmFromRepo; saveSetToRepo; saveToRepo; setGithubRepo, setLocalRepo; 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