addTagsRepo
adds new Tags to the existing Repository.
addTagsRepo(md5hashes, repoDir = NULL, FUN = NULL, tags = NULL, ...)
md5hashes | a character vector of |
---|---|
repoDir | A character that specifies the directory of the Repository to which
new |
FUN | A function which is evaluated on the artifacts for which |
tags | A character vector which specifies what kind of Tags should be added to
artifacts corresponding to given |
... | Other arguments that will be passed to FUN. |
addTagsRepo
function adds new Tags to artifacts that are already stored
in the repository. One can add new Tags
either explicitly with tags
parameter
or by passing a function which extracts Tags
from selected artifacts
corresponding to md5hashes
. To learn more about artifacts visit
archivist-package.
One should remember that length(tags)
modulo length(md5hashes)
must be equal to 0 or length(md5hashes)
modulo length(tags)
must be equal to 0.
Bug reports and feature requests can be sent to https://github.com/pbiecek/archivist/issues
Biecek P and Kosinski M (2017). "archivist: An R Package for Managing, Recording and Restoring Data Analysis Results." _Journal of Statistical Software_, *82*(11), pp. 1-28. doi: 10.18637/jss.v082.i11 (URL: http://doi.org/10.18637/jss.v082.i11). URL https://github.com/pbiecek/archivist
Other archivist: Repository
,
Tags
, %a%
,
addHooksToPrint
, aformat
,
ahistory
, alink
,
aoptions
, archivist-package
,
areadLocal
, aread
,
asearchLocal
, asearch
,
asession
, atrace
,
cache
, copyLocalRepo
,
createLocalRepo
,
createMDGallery
,
deleteLocalRepo
,
getRemoteHook
, getTagsLocal
,
loadFromLocalRepo
, md5hash
,
removeTagsRepo
, restoreLibs
,
rmFromLocalRepo
,
saveToLocalRepo
,
searchInLocalRepo
,
setLocalRepo
,
shinySearchInLocalRepo
,
showLocalRepo
,
splitTagsLocal
,
summaryLocalRepo
,
zipLocalRepo
# NOT RUN { ## We Take all artifacts of lm class from repository, ## extract R^2 for them and store as R^2:number Tags # Creating empty repository exampleRepoDir <- tempfile() createLocalRepo(exampleRepoDir, force=TRUE) # Saving lm artifacts into repository m1 <- lm(Sepal.Length~Species, iris) saveToLocalRepo(m1, exampleRepoDir) m2 <- lm(Sepal.Width~Species, iris) saveToLocalRepo(m2, exampleRepoDir) # We may see what kind of Tags are related to "m1" artifact corresponding to # "9e66edd297c2f291446f3503c01d443a" md5hash getTagsLocal("9e66edd297c2f291446f3503c01d443a", exampleRepoDir, "") # We may see what kind of Tags are related to "m2" artifact corresponding to # "da1bcaf68752c146903f700c1a458438" md5hash getTagsLocal("da1bcaf68752c146903f700c1a458438", exampleRepoDir, "") # We Take all objects of lm class from repository md5hashes <- searchInLocalRepo(repoDir=exampleRepoDir, "class:lm") # Adding new tag "test" explicitly addTagsRepo(md5hashes, exampleRepoDir, tags = "test") # Adding new tag "R^2: " using FUN parameter addTagsRepo(md5hashes, exampleRepoDir, function(x) paste0("R^2:",summary(x)$r.square)) # And now: Tags related to "m1" artifact are getTagsLocal("9e66edd297c2f291446f3503c01d443a", exampleRepoDir, "") # And now: Tags related to "m2" artifact are getTagsLocal("da1bcaf68752c146903f700c1a458438", exampleRepoDir, "") # One more look at our Repo showLocalRepo(exampleRepoDir, method = "tags") # Deleting example repository deleteLocalRepo(exampleRepoDir, deleteRoot=TRUE) rm(exampleRepoDir) # }