Last chance! 50% off unlimited learning
Sale ends in
Tags
searchInRepo
searches for an artifact in a Repository using it's Tags.
To learn more about artifacts visit archivist-package.searchInLocalRepo(pattern, repoDir, fixed = TRUE, realDBname = TRUE)searchInGithubRepo(pattern, repo, user, branch = "master", fixed = TRUE)
fixed = TRUE
: a character denoting a Tags to be searched for in the Repository.
It is also possible to specify pattern
as a list of
length 2 with dataFrom
and dataTo
; repo
is created.branch
is master
.artifacts
should be searched for.
If fixed = TRUE
(default) then artifacts are searched exactly to the corresponding pattern
parameter. If
fixed = FALSE
then artifacts are searchInRepo
returns a md5hash
character, which is a hash assigned to the artifact when
saving it to the Repository by using the saveToRepo function. If the artifact
is not in the Repository a logical value FALSE
is returned.searchInRepo
searches for an artifact in a Repository using it's Tag
(e.g., name
, class
or archiving date
). Tags
are submitted in a pattern
argument. For various artifact classes different Tags
can be searched for.
See Tags. If a pattern
is a list of length 2, md5hashes
of all
artifacts created from date dateFrom
to data dateTo
are returned. The date
should be formatted according to the YYYY-MM-DD format, e.g., "2014-07-31"
.Tags
, submitted in a pattern
argument, should be given according to the
format: "TagType:TagTypeValue"
- see examples.
Repository
;
Tags
; archivist-package
;
copyGithubRepo
,
copyLocalRepo
;
createEmptyRepo
; deleteRepo
;
loadFromGithubRepo
,
loadFromLocalRepo
; md5hash
;
rmFromRepo
; saveToRepo
;
showGithubRepo
,
showLocalRepo
;
summaryGithubRepo
,
summaryLocalRepo
# objects preparation
# data.frame object
data(iris)
# ggplot/gg object
library(ggplot2)
df <- data.frame(gp = factor(rep(letters[1:3], each = 10)),y = rnorm(30))
library(plyr)
ds <- ddply(df, .(gp), summarise, mean = mean(y), sd = sd(y))
myplot123 <- ggplot(df, aes(x = gp, y = y)) +
geom_point() + geom_point(data = ds, aes(y = mean),
colour = 'red', size = 3)
# lm object
model <- lm(Sepal.Length~ Sepal.Width + Petal.Length + Petal.Width, data= iris)
# agnes (twins) object
library(cluster)
data(votes.repub)
agn1 <- agnes(votes.repub, metric = "manhattan", stand = TRUE)
# fanny (partition) object
x <- rbind(cbind(rnorm(10, 0, 0.5), rnorm(10, 0, 0.5)),
cbind(rnorm(15, 5, 0.5), rnorm(15, 5, 0.5)),
cbind(rnorm( 3,3.2,0.5), rnorm( 3,3.2,0.5)))
fannyx <- fanny(x, 2)
# creating example Repository - that examples will work
exampleRepoDir <- tempdir()
createEmptyRepo(repoDir = exampleRepoDir)
saveToRepo(myplot123, repoDir=exampleRepoDir)
saveToRepo(iris, repoDir=exampleRepoDir)
saveToRepo(model, repoDir=exampleRepoDir)
saveToRepo(agn1, repoDir=exampleRepoDir)
saveToRepo(fannyx, repoDir=exampleRepoDir)
# let's see how the Repository look like: show
showLocalRepo(method = "md5hashes", repoDir = exampleRepoDir)
showLocalRepo(method = "tags", repoDir = exampleRepoDir)
# let's see how the Repository look like: summary
summaryLocalRepo( exampleRepoDir )
# search examples
# tag search, fixed version
searchInLocalRepo( "class:ggplot", repoDir = exampleRepoDir )
searchInLocalRepo( "name:myplot123", repoDir = exampleRepoDir )
searchInLocalRepo( "varname:Sepal.Width", repoDir = exampleRepoDir )
searchInLocalRepo( "class:lm", repoDir = exampleRepoDir )
searchInLocalRepo( "coefname:Petal.Length", repoDir = exampleRepoDir )
searchInLocalRepo( "ac:0.797755535467609", repoDir = exampleRepoDir )
# tag search, regex version
searchInLocalRepo( "class", repoDir = exampleRepoDir, fixed = FALSE )
searchInLocalRepo( "name", repoDir = exampleRepoDir, fixed = FALSE )
# Github version
# check the state of the Repository
summaryGithubRepo( user="pbiecek", repo="archivist" )
showGithubRepo( user="pbiecek", repo="archivist" )
showGithubRepo( user="pbiecek", repo="archivist", method = "tags" )
# tag search, fixed version
searchInGithubRepo( "varname:Sepal.Width", user="pbiecek", repo="archivist" )
searchInGithubRepo( "class:lm", user="pbiecek", repo="archivist", branch="master" )
searchInGithubRepo( "name:myplot123", user="pbiecek", repo="archivist" )
# tag search, regex version
searchInGithubRepo( "class", user="pbiecek", repo="archivist", fixed = FALSE )
searchInGithubRepo( "name", user="pbiecek", repo="archivist", fixed = FALSE )
# date search
# objects archivised between 2 different days
searchInLocalRepo( pattern = list( dateFrom = Sys.Date()-1, dateTo = Sys.Date()+1),
repoDir = exampleRepoDir )
# also on Github
searchInGithubRepo( pattern = list( dateFrom = "2014-08-25", dateTo = "2014-08-30" ),
user="pbiecek", repo="archivist", branch="master" )
# objects from Today
searchInLocalRepo( pattern = list( dateFrom=Sys.Date(), dateTo=Sys.Date() ),
repoDir = exampleRepoDir )
# removing an example Repository
deleteRepo( exampleRepoDir )
rm( exampleRepoDir )
Run the code above in your browser using DataLab