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.
archive(artifact, commitMessage = aoptions("commitMessage"),
repo = aoptions("repo"), user = aoptions("user"),
password = aoptions("password"), alink = aoptions("alink"),
artifactName = deparse(substitute(artifact)), verbose = FALSE, ...)
An artifact to be archived on Local and Github Repository.
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
.
A character denoting GitHub repository name and synchronized local existing directory in which an artifact will be saved.
A character denoting GitHub user name. Can be set globally with aoptions("user", user)
.
See agithub.
A character denoting GitHub user password. Can be set globally with aoptions("password", password)
.
See agithub.
The name of the artifact with which it should be archived. If NULL
then object's MD5 hash will be used instead.
A logical value. If TRUE then additional messages will be printed out.
Further arguments passed to saveToLocalRepo function.
To learn more about Archivist Integration With GitHub
visit agithub.
More about archivist.github can be found on marcinkosinski.github.io/archivist.github/ and about archivist in posts' history on https://pbiecek.github.io/archivist/articles/posts.html
Other archivist.github: archivist.github-package
,
authoriseGitHub
,
cloneGitHubRepo
,
createGitHubRepo
,
deleteGitHubRepo
,
pushGitHubRepo
# 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()
# }
Run the code above in your browser using DataLab