Learn R Programming

archivist (version 1.6)

saveSetToRepo: Save a Set of Artifacts into a Repository

Description

saveSetToRepo function saves desired set of artifacts to the local Repository in a given directory. To learn more about artifacts visit archivist-package. Set is a collection containing
  • an artifact,
  • data needed to create the artifact,
  • list of functions needed to create the artifact.

Usage

saveSetToRepo(artifact, data, functions = list(), repoDir = NULL,
  archiveData = TRUE, archiveTags = TRUE, archiveMiniature = TRUE,
  force = TRUE, rememberName = TRUE, chain = FALSE, ..., silent = FALSE,
  ascii = FALSE)

Arguments

artifact
An arbitrary R artifact to be saved. For supported artifacts see details.
data
Data needed to compute artifact.
functions
Functions needed to compute artifact. List of them is the best form.
repoDir
It's passed to the saveToRepo. A character denoting an existing directory in which an artifact will be saved. If set to NULL (by default), uses the repoDir specified in
archiveData
It's passed to the saveToRepo. A logical value denoting whether to archive the data from the artifact.
archiveTags
It's passed to the saveToRepo. A logical value denoting whether to archive tags from the artifact.
archiveMiniature
It's passed to the saveToRepo. A logical value denoting whether to archive a miniature of the artifact.
force
It's passed to the saveToRepo. A logical value denoting whether to archive artifact if it was already archived in a Repository.
rememberName
It's passed to the saveToRepo. A logical value. Should not be changed by an user. It is a technical parameter.
chain
It's passed to the saveToRepo. A logical value. Should the result be (default chain = FALSE) the md5hash of an stored artifact or should the result be the input artifact (chain = TRUE<
...
It's passed to the saveToRepo. Graphical parameters denoting width and height of a miniature. See details.
silent
It's passed to the saveToRepo. If TRUE produces no warnings.
ascii
It's passed to the saveToRepo. A logical value. An ascii argument is passed to save function.

Value

  • As a result of this function a character strings is returned, which determines the md5hash of the archived artifact.

Details

saveSetToRepo archives artifact, data and functions using saveToRepo function but additionally it adds Tags to every part of a set in convention as:set:md5hashOfArtifact to remember that all objects came originally from one set. This additional tag helps to restore a set from a Repository

See Also

For more detailed information check the archivist package https://github.com/pbiecek/archivist#-the-list-of-use-cases-{Use Cases}. The list of supported artifacts and their tags is available on wiki on archivist https://github.com/pbiecek/archivist/wiki/archivist-package---Tags{Github Repository}.

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; saveToRepo; setGithubRepo, setLocalRepo; shinySearchInLocalRepo; showGithubRepo, showLocalRepo; summaryGithubRepo, summaryLocalRepo; zipGithubRepo, zipLocalRepo

Examples

Run this code
# objects preparation
library(ggplot2)
library(ggthemes)
library(archivist)
createEmptyRepo( "SETS" )
setLocalRepo( "SETS" )
data(iris)

plotArtifact <- ggplot( iris, aes(x = Sepal.Length, y = Species)) +
  geom_point()+
  theme_wsj()

plotData <- iris
plotFunctions <- list( ggplot, geom_point, theme_wsj)

# storing
saveSetToRepo( artifact = plotArtifact,
   data = plotData,
   functions = plotFunctions)

# show method for set
showLocalRepo(method = "sets")

Run the code above in your browser using DataLab