zipRepo: Create a zip Archive From an Existing Repository

Description Usage Arguments Contact Note Author(s) References See Also Examples

Description

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

Usage

1
2
3
4
5
6
7
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'.

Contact

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

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.

Author(s)

Marcin Kosinski, m.p.kosinski@gmail.com, Przemyslaw Biecek

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

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

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# 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( ) )


## End(Not run)

archivist documentation built on Aug. 31, 2019, 5:05 p.m.