getTagsLocal {archivist}R Documentation

Return Tags Corresponding to md5hash

Description

getTagsLocal and getTagsRemote return Tags (see Tags) related to md5hash of an artifact. To learn more about artifacts visit archivist-package.

Usage

getTagsLocal(md5hash, repoDir = aoptions("repoDir"), tag = "name")

getTagsRemote(
  md5hash,
  repo = aoptions("repo"),
  user = aoptions("user"),
  branch = aoptions("branch"),
  subdir = aoptions("subdir"),
  repoType = aoptions("repoType"),
  tag = "name"
)

Arguments

md5hash

A character containing md5hash of artifacts which Tags are desired to be returned.

repoDir

A character denoting an existing directory in which artifacts are stored.

tag

A regular expression denoting type of a Tag that we search for (see Examples). Default tag = "name".

repo

While working with the Remote repository. A character containing a name of the Remote repository on which the Repository is stored. By default set to NULL - see Note.

user

While working with the Remote repository. A character containing a name of the Remote user on whose account the repo is created. By default set to NULL - see Note.

branch

While working with the Remote repository. A character containing a name of the Remote repository's branch on which the Repository is stored. Default branch is master.

subdir

While working with the Remote repository. A character containing a name of a directory on the Remote repository on which the Repository is stored. If the Repository is stored in main folder on the Remote repository, this should be set to subdir = "/" as default.

repoType

A character containing a type of the remote repository. Currently it can be 'github' or 'bitbucket'.

Details

getTagsLocal and getTagsRemote return Tags, of a specific type described by tag parameter, related to md5hash of an artifact. To learn more about artifacts visit archivist-package.

Value

The character vector of Tags (see Tags) related to md5hash of an artifact.

Contact

Bug reports and feature requests can be sent to https://github.com/pbiecek/archivist/issues

Note

If repo and user are set to NULL (as default) in Remote mode then global parameters set in setRemoteRepo function are used.

Author(s)

Marcin Kosinski, m.p.kosinski@gmail.com

References

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

See Also

Other archivist: Repository, Tags, %a%(), addHooksToPrint(), addTagsRepo(), aformat(), ahistory(), alink(), aoptions(), archivist-package, areadLocal(), aread(), asearchLocal(), asearch(), asession(), atrace(), cache(), copyLocalRepo(), createLocalRepo(), createMDGallery(), deleteLocalRepo(), getRemoteHook(), loadFromLocalRepo(), md5hash, removeTagsRepo(), restoreLibs(), rmFromLocalRepo(), saveToLocalRepo(), searchInLocalRepo(), setLocalRepo(), shinySearchInLocalRepo(), showLocalRepo(), splitTagsLocal(), summaryLocalRepo(), zipLocalRepo()

Other archivist: Repository, Tags, %a%(), addHooksToPrint(), addTagsRepo(), aformat(), ahistory(), alink(), aoptions(), archivist-package, areadLocal(), aread(), asearchLocal(), asearch(), asession(), atrace(), cache(), copyLocalRepo(), createLocalRepo(), createMDGallery(), deleteLocalRepo(), getRemoteHook(), loadFromLocalRepo(), md5hash, removeTagsRepo(), restoreLibs(), rmFromLocalRepo(), saveToLocalRepo(), searchInLocalRepo(), setLocalRepo(), shinySearchInLocalRepo(), showLocalRepo(), splitTagsLocal(), summaryLocalRepo(), zipLocalRepo()

Examples


### Local version
## Not run: 
## EXAMPLE with pipe operator %a%

# Creating empty repository
exampleRepoDir <- tempfile()
createLocalRepo( exampleRepoDir )

library(dplyr)
data(mtcars)
setLocalRepo(repoDir = exampleRepoDir)
hash <- mtcars %a% 
 group_by(cyl, am) %a%
   select(mpg, cyl, wt, am) %a%
     summarise(avgmpg = mean(mpg), avgwt = mean(wt)) %a%
       filter(avgmpg > 20) %a%
       saveToRepo( exampleRepoDir )
       
showLocalRepo(exampleRepoDir)
showLocalRepo(exampleRepoDir, method = "tags")

# We search for a Tag with default "name" regular expression corresponding to 
# hash md5hash.
getTagsLocal( md5hash = hash, exampleRepoDir )

# Deleting example respository
deleteLocalRepo( exampleRepoDir, TRUE) 
rm( exampleRepoDir ) 

## EXAMPLE with data iris
exampleRepoDir <- tempfile()
createLocalRepo( exampleRepoDir )

data(iris)
saveToRepo(iris, repoDir = exampleRepoDir )
showLocalRepo(exampleRepoDir)
showLocalRepo(exampleRepoDir, method = "tags")

# We can notice that there is only one md5hash 
# (and second for archiveSessionInfo) in repo so we will use it
hash <- showLocalRepo(exampleRepoDir)[1,1]

# We search for a Tag with "varname" regular expression corresponding to 
# hash md5hash.
getTagsLocal( md5hash = hash, exampleRepoDir, tag = "varname" ) 
# There are 5 different Tags with "varname" regular expression

# We needn't use the whole expression "varname". We may use its abbreviation
# and get the same result.
getTagsLocal( md5hash = hash, exampleRepoDir, tag = "varna" ) 

deleteLocalRepo( exampleRepoDir, TRUE) 
rm( exampleRepoDir ) 

### Remote version
## EXAMPLE: pbiecek archivist repository on GitHub

showRemoteRepo(user="pbiecek", repo="archivist")
# We search for a Tag with default "name" regular expression corresponding to 
# "cd6557c6163a6f9800f308f343e75e72" md5hash.
getTagsRemote( "cd6557c6163a6f9800f308f343e75e72",
                user="pbiecek", repo="archivist")
                
## EXAMPLE: many archivist-like Repositories on one Github repository
# We search for a Tag with default "name" regular expression corresponding to 
# "ff575c261c949d073b2895b05d1097c3" md5hash.
getTagsRemote("ff575c261c949d073b2895b05d1097c3", user="MarcinKosinski",
               repo="Museum", branch="master", subdir="ex1")

## End(Not run)               


[Package archivist version 2.3.6 Index]