writeToRepo: Write an Artifact into a Repository

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

View source: R/writeToRepo.R

Description

writeToRepo function writes an artifact to the local or remote Repository. To learn more about artifacts visit archivist2-package.

Usage

1
2
writeToRepo(artifact, repo = NULL, archiveTags = TRUE, algo = "md5",
  compress = "xz", compression_level = 9)

Arguments

artifact

An R object to be saved. For supported artifacts see details.

repo

A character denoting an repository in which an artifact will be saved. If set to NULL (by default), uses the repo specified in setRepo.

archiveTags

A logical value denoting whether to archive tags from the artifact.

algo

The algorithm to be used for hashing. Will be passed to digest().

compress

The type of compression, passed to save().

compression_level

The level of compression, passed to save().

Details

writeToRepo function writes an artifact to the local Repository (a directory) or remote Repository. In local repository artifacts are saved with additional properties like tags, which make them easier to find. Every artifact is archived in a md5hash.rda file. For every artifact, md5hash is a unique string of length 32 that comes out as a result of digest function, which uses a cryptographical MD5 hash algorithm. A specific Tag-relation is going to be added to the backpack dataset in case there is a need to load the artifact with it's related data set - see readFromRepo. Default settings may be changed by using the archiveTag argument with the FALSE value. Tags are artifact's attributes, different for various artifact's classes. For more detailed information check Tags Archived artifact can be searched in the backpack dataset by using the searchInRepo functions. Artifacts can be searched by their Tags, names, classes or archiving date. Supported artifact's classes are (so far):

To check what Tags will be extracted for various artifacts see Tags.

Value

As a result of this function a character string is returned, which determines the md5hash of the artifact that was used in the writeToRepo function.

Note

One can specify his own Tags for artifacts by setting artifact's attribute before call of the writeToRepo function like this: attr(x, "tags" ) = c( "name1", "name2" ), where x is artifact and name1, name2 are Tags specified by an user.

Author(s)

Przemyslaw Biecek, przemyslaw.biecek_at_gmail.com, Marcin Kosinski, m.p.kosinski_at_gmail.com

See Also

For more detailed information check the archivist2 package Use Cases. The list of supported artifacts and their tags is available on wiki on archivist2 Github Repository. Other archivist2: createRepo; readFromRepo; setRepo

Examples

1
2
3
4
5
# objects preparation
## Not run: 
# TODO: create examples or move from archivist

## End(Not run)

pbiecek/archivist2 documentation built on May 24, 2019, 10:36 p.m.