archivist (version 1.2)

addTagsRepo: Add new Tags to the Existing Repository

Description

addTagsRepo adds new Tags to the existing Repository.

Usage

addTagsRepo(md5hashes, repoDir, FUN = NULL, tags = NULL, ...)

Arguments

md5hashes
To which corresponding artifacts should Tags be added.
repoDir
A character that specifies the directory of the Repository into which new Tags will be added.
FUN
A function that evaluates on the artifacts for which md5hashes are given and generates Tags as a result that will be added to the local Repository. Can be specified only one of: FUN or tags.
tags
A character vector that specifies what tag should be added to which artifact that corresponds to given md5hash. Can be specified only one of: FUN or tags. Should have length 1 or the same as length of m
...
Other arguments that will be passed to FUN.

Details

The addTagsRepo function adds new tags to artifacts that are already stored in repository. One can add new tags explicitly with tags argument, or by passing a function that extracts tags from selected artifacts specified by passing their md5hash. To learn more about artifacts visit archivist-package.

Tags are attributes of an artifact. Tags can be an artifact's name, class or archiving date. Furthermore, for various artifact's classes more different Tags are available and can be searched in searchInLocalRepo or searchInGithubRepo functions.

See Also

Other archivist: Repository; Tags; archivist-package; cache; copyGithubRepo, copyLocalRepo; createEmptyRepo; deleteRepo; getTagsGithub, getTagsLocal; loadFromGithubRepo, loadFromLocalRepo; md5hash; multiSearchInGithubRepo, multiSearchInLocalRepo, searchInGithubRepo, searchInLocalRepo; rmFromRepo; saveToRepo; shinySearchInLocalRepo; showGithubRepo, showLocalRepo; summaryGithubRepo, summaryLocalRepo; zipGithubRepo, zipLocalRepo

Examples

Run this code
# Takes all objects of lm class from repository,
# extracts R2 for them and stores as R2: tags

exampleRepoDir <- tempdir()
createEmptyRepo(exampleRepoDir, force=TRUE)
m1 <- lm(Sepal.Length~Species, iris)
saveToRepo(m1, exampleRepoDir)
m1 <- lm(Sepal.Width~Species, iris)
saveToRepo(m1, exampleRepoDir)
getTagsLocal("da1bcaf68752c146903f700c1a458438", exampleRepoDir, "")
md5hashes <- searchInLocalRepo(repoDir=exampleRepoDir, "class:lm")
addTagsRepo(md5hashes, exampleRepoDir, tags = "test")
addTagsRepo(md5hashes, exampleRepoDir, function(x) paste0("R2:",summary(x)$r.square))
getTagsLocal("da1bcaf68752c146903f700c1a458438", exampleRepoDir, "")
showLocalRepo(exampleRepoDir)
deleteRepo(exampleRepoDir)

Run the code above in your browser using DataLab