archivist (version 2.1.2)

zipLocalRepo: Create a zip Archive From an Existing Repository

Description

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

Usage

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'.

See Also

Other archivist: Repository, Tags, %a%, addHooksToPrint, addTagsRepo, aformat, ahistory, alink, aoptions, archivist-package, aread, asearch, asession, atrace, cache, copyLocalRepo, createLocalRepo, createMDGallery, deleteLocalRepo, getRemoteHook, getTagsLocal, loadFromLocalRepo, md5hash, restoreLibs, rmFromLocalRepo, saveToLocalRepo, searchInLocalRepo, setLocalRepo, shinySearchInLocalRepo, showLocalRepo, splitTagsLocal, summaryLocalRepo

Other archivist: Repository, Tags, %a%, addHooksToPrint, addTagsRepo, aformat, ahistory, alink, aoptions, archivist-package, aread, asearch, asession, atrace, cache, copyLocalRepo, createLocalRepo, createMDGallery, deleteLocalRepo, getRemoteHook, getTagsLocal, loadFromLocalRepo, md5hash, restoreLibs, rmFromLocalRepo, saveToLocalRepo, searchInLocalRepo, setLocalRepo, shinySearchInLocalRepo, showLocalRepo, splitTagsLocal, summaryLocalRepo

Examples

Run this code
# NOT RUN {
# 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( ) )

# }
# NOT RUN {
# }

Run the code above in your browser using DataCamp Workspace