archive: Archive Artifact to Local and GitHub Repository

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

View source: R/archive.R

Description

archive stores artifacts in the local Repository and automatically pushes archived artifacts to the GitHub Repository with which the local Repository is synchronized (via createGitHubRepo or cloneGitHubRepo). Function stores artifacts on the same way as saveToLocalRepo function.

This function is well explained on this http://r-bloggers.com/r-hero-saves-backup-city-with-archivist-and-github blog post.

Usage

1
2
3
4
archive(artifact, commitMessage = aoptions("commitMessage"),
  repo = aoptions("repo"), user = aoptions("user"),
  password = aoptions("password"), alink = aoptions("alink"),
  artifactName = deparse(substitute(artifact)), verbose = FALSE, ...)

Arguments

artifact

An artifact to be archived on Local and Github Repository.

commitMessage

A character denoting a message added to the commit while archiving artifact on GitHub Repository. By default, an artifact's md5hash is added to the commit message when it is specified to NULL.

repo

A character denoting GitHub repository name and synchronized local existing directory in which an artifact will be saved.

user

A character denoting GitHub user name. Can be set globally with aoptions("user", user). See agithub.

password

A character denoting GitHub user password. Can be set globally with aoptions("password", password). See agithub.

alink

Logical. Whether the result should be put into alink function. If you would like to pass further arguments to alink then you should specify them with aoptions in this case.

artifactName

The name of the artifact with which it should be archived. If NULL then object's MD5 hash will be used instead.

verbose

A logical value. If TRUE then additional messages will be printed out.

...

Further arguments passed to saveToLocalRepo function.

Details

To learn more about Archivist Integration With GitHub visit agithub.

Note

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

Author(s)

Marcin Kosinski, [email protected]

References

More about archivist.github can be found on marcinkosinski.github.io/archivist.github/ and about archivist in posts' history on http://pbiecek.github.io/archivist/Posts.html

See Also

Other archivist.github: archivist.github-package, authoriseGitHub, cloneGitHubRepo, createGitHubRepo, deleteGitHubRepo, pushGitHubRepo

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
## Not run: 

# empty GitHub Repository creation
authoriseGitHub(ClientID, ClientSecret) -> github_token
# authoriseGitHub also does: aoptions("github_token", github_token)
aoptions("user", user.name)
aoptions("password", user.password)

createGitHubRepo("archive-test4", default = TRUE)
## artifact's archiving
exampleVec <- 1:100

# archiving
archive(exampleVec) -> md5hash_path

## proof that artifact is really archived
showGithubRepo() # uses options from setGithubRepo
# let's remove exampleVec
rm(exampleVec)
# and load it back from md5hash_path
aread(md5hash_path)


# clone example
unlink("archive-test", recursive = TRUE)
cloneGithubRepo('https://github.com/MarcinKosinski/archive-test')
setRemoteRepo(aoptions("user"), "archive-test")
data(iris)
archive(iris)
showRemoteRepo()

## alink() option
vectorLong <- 1:100
vectorShort <- 1:20
# archiving
alink(archive(vectorLong))
archive(vectorShort, alink = TRUE)
showRemoteRepo()



## End(Not run)

MarcinKosinski/archivist.github documentation built on July 28, 2018, 5:14 a.m.