| Version: | 2.3.8 |
| Type: | Package |
| Title: | Tools for Storing, Restoring and Searching for R Objects |
| Description: | Data exploration and modelling is a process in which a lot of data artifacts are produced. Artifacts like: subsets, data aggregates, plots, statistical models, different versions of data sets and different versions of results. The more projects we work with the more artifacts are produced and the harder it is to manage these artifacts. Archivist helps to store and manage artifacts created in R. Archivist allows you to store selected artifacts as a binary files together with their metadata and relations. Archivist allows to share artifacts with others, either through shared folder or github. Archivist allows to look for already created artifacts by using it's class, name, date of the creation or other properties. Makes it easy to restore such artifacts. Archivist allows to check if new artifact is the exact copy that was produced some time ago. That might be useful either for testing or caching. |
| Repository: | CRAN |
| License: | GPL-2 |
| LazyLoad: | yes |
| Depends: | R (≥ 3.2.0) |
| Imports: | RCurl, digest, httr, DBI, lubridate, RSQLite, magrittr, flock |
| Suggests: | shiny, dplyr, testthat, ggplot2, devtools, knitr, markdown,rmarkdown |
| Encoding: | UTF-8 |
| URL: | https://pbiecek.github.io/archivist/ |
| BugReports: | https://github.com/pbiecek/archivist/issues |
| RoxygenNote: | 7.3.2 |
| NeedsCompilation: | no |
| Packaged: | 2024-08-28 22:08:42 UTC; pbiecek |
| Author: | Przemyslaw Biecek [aut, cre], Marcin Kosinski [aut], Witold Chodor [ctb] |
| Maintainer: | Przemyslaw Biecek <przemyslaw.biecek@gmail.com> |
| Date/Publication: | 2024-08-29 02:20:07 UTC |
Tools for Storing, Restoring and Searching for R Objects
Description
Data exploration and modelling is a process in which a lot of data artifacts are produced. Artifacts like: subsets, data aggregates, plots, statistical models, different versions of data sets and different versions of results. The more projects we work on, the more artifacts are produced and the harder it is to manage these artifacts.
Archivist helps to store and manage artifacts created in R.
Archivist allows you to store selected artifacts as binary filesalong with their metadata and relations.Archivist allows you to share artifacts with others, either through a shared folder or github.Archivist allows you to look for artifacts by using its class, name, date of creation or other properties.It also facilitates restoring such artifacts.Archivist allows you to check if a new artifact is the exact copy of the one that was produced some time ago.This might be useful either for testing or caching.
The list of main use cases is available herehttps://github.com/pbiecek/archivist.
Extensions ofarchivist are
Tools for Archiving, Managing and Sharing R Objects via GitHub: archivist.github
Details
For more detailed information visitarchivistwiki onGithub.
Contact
Bug reports and feature requests can be sent tohttps://github.com/pbiecek/archivist/issues
Blogging
We have prepared history of blog posts and conference talks aboutarchivist under this linkhttp://pbiecek.github.io/archivist/articles/posts.html
Author(s)
Przemyslaw Biecek [aut, cre]przemyslaw.biecek@gmail.com
Marcin Kosinski [aut]m.p.kosinski@gmail.com
Witold Chodor [ctb]witold.chodor@gmail.com
References
Biecek P and Kosinski M (2017). "archivist: An R Package for Managing,Recording and Restoring Data Analysis Results." _Journal of StatisticalSoftware_, *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
Useful links:
Other archivist:Repository,Tags,%a%(),addHooksToPrint(),addTagsRepo(),aformat(),ahistory(),alink(),aoptions(),aread(),areadLocal(),asearch(),asearchLocal(),asession(),atrace(),cache(),copyLocalRepo(),createLocalRepo(),createMDGallery(),deleteLocalRepo(),getRemoteHook(),getTagsLocal(),loadFromLocalRepo(),md5hash,removeTagsRepo(),restoreLibs(),rmFromLocalRepo(),saveToLocalRepo(),searchInLocalRepo(),setLocalRepo(),shinySearchInLocalRepo(),showLocalRepo(),splitTagsLocal(),summaryLocalRepo(),zipLocalRepo()
Pipe operator
Description
See%>% for more details.
Usage
lhs %>% rhsmagrittr - a Forward-Pipe Operator for R
Description
An extended pipe operator%>% from magrittr package version 1.0.1.Enables archiving artifacts with their chaining code - see examples and vignettes.
Usage
lhs %a% rhsArguments
lhs | An artifact that will be used as an argument of |
rhs | A function call using |
Details
The extension works as follows, the result of%a% operator is archived together with lhs (as an artifact) and rhs (as a Tag). This allows to present a history ofan artifact. This option works only if a default repository is set.
Contact
Bug reports and feature requests can be sent tohttps://github.com/pbiecek/archivist/issues
Demonstration
This function is well explained on this blog post.
See Also
Other archivist:Repository,Tags,addHooksToPrint(),addTagsRepo(),aformat(),ahistory(),alink(),aoptions(),archivistPackage,aread(),areadLocal(),asearch(),asearchLocal(),asession(),atrace(),cache(),copyLocalRepo(),createLocalRepo(),createMDGallery(),deleteLocalRepo(),getRemoteHook(),getTagsLocal(),loadFromLocalRepo(),md5hash,removeTagsRepo(),restoreLibs(),rmFromLocalRepo(),saveToLocalRepo(),searchInLocalRepo(),setLocalRepo(),shinySearchInLocalRepo(),showLocalRepo(),splitTagsLocal(),summaryLocalRepo(),zipLocalRepo()
Examples
## Not run: library("dplyr")## Usage of %a% operator without setting default repository# We will receive special warningiris %a% summary()## Archiving artifacts with their chaining code# Creating empty repositoryexampleRepoDir <- tempfile()createLocalRepo( exampleRepoDir, default = TRUE ) # Remember to set repo to default# Start using %a% operatordata("hflights", package = "hflights")hflights %a% group_by(Year, Month, DayofMonth) %a% select(Year:DayofMonth, ArrDelay, DepDelay) %a% summarise(arr = mean(ArrDelay, na.rm = TRUE), dep = mean(DepDelay, na.rm = TRUE)) %a% filter(arr > 30 | dep > 30) # Let's check how Tags of subsequent artifacts look likeshowLocalRepo()getTagsLocal("a8ce013a8e66df222be278122423dc60", tag = "") #1getTagsLocal("9d91fe67fd51f3bfdc9db0a596b12b38", tag = "") #2getTagsLocal("617ded4953ac986524a1c24703363980", tag = "") #3getTagsLocal("3f1ac0a27485be5d52e1b0a41d165abc", tag = "") #4getTagsLocal("0cb04315482de73d7f5a1081953236f8", tag = "") #5getTagsLocal("5629bc43e36d219b613076b17c665eda", tag = "") #6# Deleting existing repositorydeleteLocalRepo(exampleRepoDir, deleteRoot = TRUE)rm(exampleRepoDir) ## End(Not run)Repository
Description
Repository stores specific values of an artifact, different for various artifact's classes and artifacts themselves.To learn more about artifacts visitarchivistPackage.
Details
Repository is a folder with an SQLite database stored in a file namedbackpackand a subdirectory namedgallery.
backpack contains two tables:artifact andtag.artifact table consists of three columns:
md5hash,name,createdDate,
whiletag table consists of the following three columns:
artifact,tag,createdDate.
gallery collects the following objects:
artifacts and artifacts' data saved as
.rdafiles,artifacts' miniatures saved as
.txtand.pngfiles.
Contact
Bug reports and feature requests can be sent tohttps://github.com/pbiecek/archivist/issues
References
Biecek P and Kosinski M (2017). "archivist: An R Package for Managing,Recording and Restoring Data Analysis Results." _Journal of StatisticalSoftware_, *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
Functions usingRepository are:
Function creatingRepository is:
Function deletingRepository is:
Functions copingRepository are:
Functions creating a zip archive from an existingRepository are:
Functions setting global path to theRepository are:
Learn more aboutRepository atarchivistwiki webpage onGithub.
Other archivist:Tags,%a%(),addHooksToPrint(),addTagsRepo(),aformat(),ahistory(),alink(),aoptions(),archivistPackage,aread(),areadLocal(),asearch(),asearchLocal(),asession(),atrace(),cache(),copyLocalRepo(),createLocalRepo(),createMDGallery(),deleteLocalRepo(),getRemoteHook(),getTagsLocal(),loadFromLocalRepo(),md5hash,removeTagsRepo(),restoreLibs(),rmFromLocalRepo(),saveToLocalRepo(),searchInLocalRepo(),setLocalRepo(),shinySearchInLocalRepo(),showLocalRepo(),splitTagsLocal(),summaryLocalRepo(),zipLocalRepo()
Tags
Description
Tags are attributes of an artifact, i.e., a class, a name, names of artifact's parts, etc... The list of artifact tags vary across artifact's classes. To learn more about artifacts visitarchivistPackage.
Details
Tags are attributes of an artifact. They can be the artifact'sname,class orarchiving date. Furthermore, for various artifact's classes more differentTags are available.
ATag is represented as a string and usually has the following structure"TagKey:TagValue", e.g.,"name:iris".
Tags are stored in theRepository. If data is extracted from an artifactthen a specialTag, namedrelationWith is created.It specifies with which artifact this data is related to.
The list of supported artifacts which are divided thematically is presented below.The newest list is also available onarchivistwiki onGithub.
Regression Models
lmname
class
coefname
rank
df.residual
date
summary.lmname
class
sigma
df
r.squared
adj.r.squared
fstatistic
fstatistic.df
date
glmnetname
class
dim
nulldev
npasses
offset
nobs
date
survfitname
class
n
type
conf.type
conf.int
strata
date
Plots
ggplotname
class
date
labelx
labely
trellisdate
name
class
Results of Agglomeration Methods
twins which is a result of agnes, diana or mona functionsdate
name
class
ac
partition which is a result of pam, clara or fanny functionsname
class
memb.exp
dunn_coeff
normalized dunn_coeff
k.crisp
objective
tolerance
iterations
converged
maxit
clus.avg.widths
avg.width
date
ldaname
class
N
lev
counts
prior
svd
date
qdaname
class
N
lev
counts
prior
ldet
terms
date
Statistical Tests
htestname
class
method
data.name
null.value
alternative
statistic
parameter
p.value
conf.int.
estimate
date
When none of above is specified, Tags are assigned by default
defaultname
class
date
data.framename
class
date
varname
Contact
Bug reports and feature requests can be sent tohttps://github.com/pbiecek/archivist/issues
Note
In the following way one can specify his ownTags for artifacts by setting artifact's attribute before call of thesaveToLocalRepo function:attr(x, "tags" ) = c( "name1", "name2" ), wherex is an artifact andname1, name2 areTags specified by a user.It can be also done in a new, simpler way by usinguserTags parameter like this:
saveToLocalRepo(model, repoDir, userTags = c("my_model", "do not delete")).
Specifing additionalTags by attributes can be beneficial when one usesaddHooksToPrint.
References
Biecek P and Kosinski M (2017). "archivist: An R Package for Managing,Recording and Restoring Data Analysis Results." _Journal of StatisticalSoftware_, *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
Functions usingTags are:
Other archivist:Repository,%a%(),addHooksToPrint(),addTagsRepo(),aformat(),ahistory(),alink(),aoptions(),archivistPackage,aread(),areadLocal(),asearch(),asearchLocal(),asession(),atrace(),cache(),copyLocalRepo(),createLocalRepo(),createMDGallery(),deleteLocalRepo(),getRemoteHook(),getTagsLocal(),loadFromLocalRepo(),md5hash,removeTagsRepo(),restoreLibs(),rmFromLocalRepo(),saveToLocalRepo(),searchInLocalRepo(),setLocalRepo(),shinySearchInLocalRepo(),showLocalRepo(),splitTagsLocal(),summaryLocalRepo(),zipLocalRepo()
Examples
## Not run: # examples# data.frame objectdata(iris)exampleRepoDir <- tempfile()createLocalRepo(repoDir = exampleRepoDir)saveToLocalRepo( iris, repoDir=exampleRepoDir )showLocalRepo( exampleRepoDir, "tags" )deleteLocalRepo( exampleRepoDir, deleteRoot=TRUE )# ggplot/gg objectlibrary(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)exampleRepoDir <- tempfile()createLocalRepo( repoDir = exampleRepoDir )saveToLocalRepo( myplot123, repoDir=exampleRepoDir )showLocalRepo( exampleRepoDir, "tags" )deleteLocalRepo( exampleRepoDir, deleteRoot=TRUE )# lm objectmodel <- lm(Sepal.Length~ Sepal.Width + Petal.Length + Petal.Width, data= iris)exampleRepoDir <- tempfile()createLocalRepo( repoDir = exampleRepoDir )asave( model, repoDir=exampleRepoDir )showLocalRepo( exampleRepoDir, "tags" )deleteLocalRepo( exampleRepoDir, TRUE )# agnes (twins) objectlibrary(cluster)data(votes.repub)agn1 <- agnes(votes.repub, metric = "manhattan", stand = TRUE)exampleRepoDir <- tempfile()createLocalRepo( repoDir = exampleRepoDir )saveToLocalRepo( agn1, repoDir=exampleRepoDir )showLocalRepo( exampleRepoDir, "tags" )deleteLocalRepo( exampleRepoDir, TRUE )# fanny (partition) objectx <- 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)exampleRepoDir <- tempfile()createLocalRepo( repoDir = exampleRepoDir )saveToLocalRepo( fannyx, repoDir=exampleRepoDir )showLocalRepo( exampleRepoDir, "tags" )deleteLocalRepo( exampleRepoDir, TRUE )# lda objectlibrary(MASS)Iris <- data.frame(rbind(iris3[,,1], iris3[,,2], iris3[,,3]), Sp = rep(c("s","c","v"), rep(50,3)))train <- c(8,83,115,118,146,82,76,9,70,139,85,59,78,143,68, 134,148,12,141,101,144,114,41,95,61,128,2,42,37, 29,77,20,44,98,74,32,27,11,49,52,111,55,48,33,38, 113,126,24,104,3,66,81,31,39,26,123,18,108,73,50, 56,54,65,135,84,112,131,60,102,14,120,117,53,138,5)lda1 <- lda(Sp ~ ., Iris, prior = c(1,1,1)/3, subset = train)exampleRepoDir <- tempfile()createLocalRepo( repoDir = exampleRepoDir )asave( lda1, repoDir=exampleRepoDir )showLocalRepo( exampleRepoDir, "tags" )deleteLocalRepo( exampleRepoDir, TRUE )# qda objecttr <- c(7,38,47,43,20,37,44,22,46,49,50,19,4,32,12,29,27,34,2,1,17,13,3,35,36)train <- rbind(iris3[tr,,1], iris3[tr,,2], iris3[tr,,3])cl <- factor(c(rep("s",25), rep("c",25), rep("v",25)))qda1 <- qda(train, cl)exampleRepoDir <- tempfile()createLocalRepo( repoDir = exampleRepoDir )saveToLocalRepo( qda1, repoDir=exampleRepoDir )showLocalRepo( exampleRepoDir, "tags" )deleteLocalRepo( exampleRepoDir, TRUE )# glmnet objectlibrary( glmnet )zk=matrix(rnorm(100*20),100,20)bk=rnorm(100)glmnet1=glmnet(zk,bk)exampleRepoDir <- tempfile()createLocalRepo( repoDir = exampleRepoDir )saveToLocalRepo( glmnet1, repoDir=exampleRepoDir )showLocalRepo( exampleRepoDir, "tags" )deleteLocalRepo( exampleRepoDir, TRUE )# trellis objectrequire(stats)library( lattice)## Tonga Trench EarthquakesDepth <- equal.count(quakes$depth, number=8, overlap=.1)xyplot(lat ~ long | Depth, data = quakes)update(trellis.last.object(), strip = strip.custom(strip.names = TRUE, strip.levels = TRUE), par.strip.text = list(cex = 0.75), aspect = "iso")## Examples with data from `Visualizing Data' (Cleveland, 1993) obtained## from http://cm.bell-labs.com/cm/ms/departments/sia/wsc/EE <- equal.count(ethanol$E, number=9, overlap=1/4)## Constructing panel functions on the run; prepaneltrellis.plot <- xyplot(NOx ~ C | EE, data = ethanol, prepanel = function(x, y) prepanel.loess(x, y, span = 1), xlab = "Compression Ratio", ylab = "NOx (micrograms/J)", panel = function(x, y) { panel.grid(h = -1, v = 2) panel.xyplot(x, y) panel.loess(x, y, span=1) }, aspect = "xy")exampleRepoDir <- tempfile()createLocalRepo( repoDir = exampleRepoDir )saveToLocalRepo( trellis.plot, repoDir=exampleRepoDir )showLocalRepo( exampleRepoDir, "tags" )deleteLocalRepo( exampleRepoDir, TRUE )# htest objectx <- c(1.83, 0.50, 1.62, 2.48, 1.68, 1.88, 1.55, 3.06, 1.30)y <- c(0.878, 0.647, 0.598, 2.05, 1.06, 1.29, 1.06, 3.14, 1.29)this.test <- wilcox.test(x, y, paired = TRUE, alternative = "greater")exampleRepoDir <- tempfile()createLocalRepo( repoDir = exampleRepoDir )saveToLocalRepo( this.test, repoDir=exampleRepoDir )showLocalRepo( exampleRepoDir, "tags" )deleteLocalRepo( exampleRepoDir, TRUE )# survfit objectlibrary( survival )# Create the simplest test data set test1 <- list(time=c(4,3,1,1,2,2,3), status=c(1,1,1,0,1,1,0), x=c(0,2,1,1,1,0,0), sex=c(0,0,0,0,1,1,1)) # Fit a stratified model myFit <- survfit( coxph(Surv(time, status) ~ x + strata(sex), test1), data = test1 )exampleRepoDir <- tempfile()createLocalRepo( repoDir = exampleRepoDir )saveToLocalRepo( myFit , repoDir=exampleRepoDir )showLocalRepo( exampleRepoDir, "tags" )[,-3]deleteLocalRepo( exampleRepoDir, TRUE)# origin of the artifacts stored as a name - chaining codelibrary(dplyr)exampleRepoDir <- tempfile()createLocalRepo( repoDir = exampleRepoDir )data("hflights", package = "hflights")hflights %>% group_by(Year, Month, DayofMonth) %>% select(Year:DayofMonth, ArrDelay, DepDelay) %>% saveToLocalRepo( exampleRepoDir, value = TRUE ) %>% # here the artifact is stored but chaining is not finished summarise( arr = mean(ArrDelay, na.rm = TRUE), dep = mean(DepDelay, na.rm = TRUE) ) %>% filter(arr > 30 | dep > 30) %>% saveToLocalRepo( exampleRepoDir ) # chaining code is finished and after last operation the # artifact is storedshowLocalRepo( exampleRepoDir, "tags" )[,-3]showLocalRepo( exampleRepoDir )deleteLocalRepo( exampleRepoDir, TRUE)rm( exampleRepoDir )## End(Not run)Addarchivist Hooks tormarkdown Reports
Description
addHooksToPrint adds an overloaded version of the print function for objects of selected class. The overloaded function will add all objects of selected class to theRepository and then will add hooks (to the Remote or Local Repository) to the HTML report (generated inrmarkdown) for these objects (artifacts -archivistPackage).The great example can be seen in this blogpost.
Usage
addHooksToPrint( class = "ggplot", repoDir = aoptions("repoDir"), repo = aoptions("repo"), user = aoptions("user"), branch = "master", subdir = aoptions("subdir"), format = "markdown")Arguments
class | A character with a name of class (one or more) that should be archived. |
repoDir | A character containing a name of a Local Repository. |
repo | A character with a name of a Remote repository on which the Repository is archived.If |
user | A character with a name of a Remote-repository user on whose account the |
branch | A character with a name of Remote-repository's branch on which the Repository is archived. Default |
subdir | A character with a name of a sub directory on a Remote repository on which the Repository is stored. If the Repository is stored in main folder on a Remote repository, this should be set to |
format | A character denoting |
Contact
Bug reports and feature requests can be sent tohttps://github.com/pbiecek/archivist/issues
Note
One can specifyuserTags as insaveToLocalRepo for artifacts by adding"tags" attribute.See note section about that insaveToLocalRepo.
Author(s)
Przemyslaw Biecek,przemyslaw.biecek@gmail.com
References
Biecek P and Kosinski M (2017). "archivist: An R Package for Managing,Recording and Restoring Data Analysis Results." _Journal of StatisticalSoftware_, *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%(),addTagsRepo(),aformat(),ahistory(),alink(),aoptions(),archivistPackage,aread(),areadLocal(),asearch(),asearchLocal(),asession(),atrace(),cache(),copyLocalRepo(),createLocalRepo(),createMDGallery(),deleteLocalRepo(),getRemoteHook(),getTagsLocal(),loadFromLocalRepo(),md5hash,removeTagsRepo(),restoreLibs(),rmFromLocalRepo(),saveToLocalRepo(),searchInLocalRepo(),setLocalRepo(),shinySearchInLocalRepo(),showLocalRepo(),splitTagsLocal(),summaryLocalRepo(),zipLocalRepo()
Examples
## Not run: # only in Rmd report, links to github repositoryaddHooksToPrint(class="ggplot", repoDir = "arepo",repo="graphGallery", user="pbiecek")# only in Rmd report, links to local filesaddHooksToPrint(class="ggplot", repoDir = "arepo",repo=NULL)## End(Not run)Add new Tags to the Existing Repository
Description
addTagsRepo adds newTags to the existingRepository.
Usage
addTagsRepo(md5hashes, repoDir = NULL, FUN = NULL, tags = NULL, ...)Arguments
md5hashes | a character vector of |
repoDir | A character that specifies the directory of the Repository to whichnew |
FUN | A function which is evaluated on the artifacts for which |
tags | A character vector which specifies what kind of Tags should be added toartifacts corresponding to given |
... | Other arguments that will be passed to FUN. |
Details
addTagsRepo function adds new Tags to artifacts that are already storedin the repository. One can add newTags either explicitly withtags parameteror by passing a function which extractsTags from selected artifactscorresponding tomd5hashes. To learn more about artifacts visitarchivistPackage.
Contact
Bug reports and feature requests can be sent tohttps://github.com/pbiecek/archivist/issues
Note
One should remember thatlength(tags) modulolength(md5hashes) must be equal to 0 orlength(md5hashes) modulolength(tags)must be equal to 0.
Author(s)
Marcin Kosinski,m.p.kosinski@gmail.com, Przemyslaw Biecek,przemyslaw.biecek@gmail.com
References
Biecek P and Kosinski M (2017). "archivist: An R Package for Managing,Recording and Restoring Data Analysis Results." _Journal of StatisticalSoftware_, *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(),aformat(),ahistory(),alink(),aoptions(),archivistPackage,aread(),areadLocal(),asearch(),asearchLocal(),asession(),atrace(),cache(),copyLocalRepo(),createLocalRepo(),createMDGallery(),deleteLocalRepo(),getRemoteHook(),getTagsLocal(),loadFromLocalRepo(),md5hash,removeTagsRepo(),restoreLibs(),rmFromLocalRepo(),saveToLocalRepo(),searchInLocalRepo(),setLocalRepo(),shinySearchInLocalRepo(),showLocalRepo(),splitTagsLocal(),summaryLocalRepo(),zipLocalRepo()
Examples
## 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 repositoryexampleRepoDir <- tempfile()createLocalRepo(exampleRepoDir, force=TRUE)# Saving lm artifacts into repositorym1 <- 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" md5hashgetTagsLocal("9e66edd297c2f291446f3503c01d443a", exampleRepoDir, "")# We may see what kind of Tags are related to "m2" artifact corresponding to# "da1bcaf68752c146903f700c1a458438" md5hashgetTagsLocal("da1bcaf68752c146903f700c1a458438", exampleRepoDir, "")# We Take all objects of lm class from repositorymd5hashes <- searchInLocalRepo(repoDir=exampleRepoDir, "class:lm")# Adding new tag "test" explicitlyaddTagsRepo(md5hashes, exampleRepoDir, tags = "test")# Adding new tag "R^2: " using FUN parameteraddTagsRepo(md5hashes, exampleRepoDir, function(x) paste0("R^2:",summary(x)$r.square))# And now: Tags related to "m1" artifact aregetTagsLocal("9e66edd297c2f291446f3503c01d443a", exampleRepoDir, "")# And now: Tags related to "m2" artifact aregetTagsLocal("da1bcaf68752c146903f700c1a458438", exampleRepoDir, "")# One more look at our ReposhowLocalRepo(exampleRepoDir, method = "tags")# Deleting example repositorydeleteLocalRepo(exampleRepoDir, deleteRoot=TRUE)rm(exampleRepoDir)## End(Not run)Show Artifact's List of Formats
Description
aformat extracts artifact's formats. Having formats one may decide which should he read.Currently only rda format is supported for artifact and txt/png for miniatures.
Usage
aformat(md5hash = NULL)Arguments
md5hash | One of the following (seearead): A character vector which elements are consisting of at least three components separated with '/': Remote user name, Remote repository and name of the artifact (MD5 hash) or it's abbreviation. MD5 hashes of artifacts in current local default directory or its abbreviations. |
Value
A vector of characters.
Contact
Bug reports and feature requests can be sent tohttps://github.com/pbiecek/archivist/issues
Author(s)
Przemyslaw Biecek,przemyslaw.biecek@gmail.com
References
Biecek P and Kosinski M (2017). "archivist: An R Package for Managing,Recording and Restoring Data Analysis Results." _Journal of StatisticalSoftware_, *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(),ahistory(),alink(),aoptions(),archivistPackage,aread(),areadLocal(),asearch(),asearchLocal(),asession(),atrace(),cache(),copyLocalRepo(),createLocalRepo(),createMDGallery(),deleteLocalRepo(),getRemoteHook(),getTagsLocal(),loadFromLocalRepo(),md5hash,removeTagsRepo(),restoreLibs(),rmFromLocalRepo(),saveToLocalRepo(),searchInLocalRepo(),setLocalRepo(),shinySearchInLocalRepo(),showLocalRepo(),splitTagsLocal(),summaryLocalRepo(),zipLocalRepo()
Examples
## Not run: setLocalRepo(system.file("graphGallery", package = "archivist"))aformat("2a6e492cb6982f230e48cf46023e2e4f")# oldaformat("pbiecek/graphGallery/2a6e492cb6982f230e48cf46023e2e4f")# pngaformat("pbiecek/graphGallery/7f3453331910e3f321ef97d87adb5bad")## End(Not run)Show Artifact's History
Description
ahistory extracts artifact's history and creates a data frame with history of calls and md5hashes of partial results. The overloadedprint.ahistory function prints this history in a concise way. The overloadedprint.ahistoryKable function prints this history in the same way askable.Whenalink=TRUE one can create history table/kable with hooks to partial results (artifacts) as in thealink function.
Usage
ahistory( artifact = NULL, md5hash = NULL, repoDir = aoptions("repoDir"), format = "regular", alink = FALSE, ...)Arguments
artifact | An artifact which history is supposed to be reconstructed.It will be converted into md5hash. |
md5hash | If |
repoDir | A character denoting an existing directory in which an artifact will be saved. |
format | A character denoting whether to print history in either a |
alink | Whether to provide hooks to objects like inalink. See examples. |
... | Further parameters passed toalink function. Used when |
Details
All artifacts created with%a% operator are archivised with detailed information about it's source (both call and md5hash of the input).The functionahistory reads all artifacts that precedeartifact and create a description of the input flow. The genericprint.ahistory function plots the history in a human readable way.
Value
A data frame with two columns - names of calls and md5hashes of partial results.
Contact
Bug reports and feature requests can be sent tohttps://github.com/pbiecek/archivist/issues
Demonstration
This function is well explained on this blog post.
Note
There are provided functions (print.ahistory andprint.ahistoryKable) to print the artifact's history. History can be printed either in aregular way which is friendly for the console output or in akable format which prints the artifact's history in a waykable function would. This is convenient when one prints historyin.Rmd files usingrmarkdown.
Moreover when user passesformat = 'kable' andalink = TRUE then one can use links for remote Repository. Then md5hashes are taken from Local Repository, so user has to specifyrepo,user andrepoDir even though they are set globally, becauserepo is a substring ofrepoDir and during evaluation of... R treatsrepo asrepoDir.
Author(s)
Przemyslaw Biecek,przemyslaw.biecek@gmail.com
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 StatisticalSoftware_, *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(),alink(),aoptions(),archivistPackage,aread(),areadLocal(),asearch(),asearchLocal(),asession(),atrace(),cache(),copyLocalRepo(),createLocalRepo(),createMDGallery(),deleteLocalRepo(),getRemoteHook(),getTagsLocal(),loadFromLocalRepo(),md5hash,removeTagsRepo(),restoreLibs(),rmFromLocalRepo(),saveToLocalRepo(),searchInLocalRepo(),setLocalRepo(),shinySearchInLocalRepo(),showLocalRepo(),splitTagsLocal(),summaryLocalRepo(),zipLocalRepo()
Examples
createLocalRepo("ahistory_check", default = TRUE)library(dplyr)iris %a%filter(Sepal.Length < 6) %a% lm(Petal.Length~Species, data=.) %a% summary() -> artifact ahistory(artifact)ahistory(artifact, format = "kable") print(ahistory(artifact, format = "kable"), format = "latex")ahistory(artifact, format = "kable", alink = TRUE, repoDir = "ahistory_check",repo = "repo", user = "user")repoDir <- file.path(getwd(), "ahistory_check")deleteLocalRepo(repoDir, deleteRoot = TRUE)aoptions('repoDir', NULL, unset = TRUE)Return a Link To Download an Artifact Stored on Remote Repository
Description
alink returns a link to download an artifact from the RemoteRepository.Artifact has to be already archived on GitHub, e.g with archive function archivist.github package (recommended) orsaveToRepo function and traditional Git manual synchronization.To learn more about artifacts visitarchivistPackage.
Usage
alink( md5hash, repo = aoptions("repo"), user = aoptions("user"), subdir = aoptions("subdir"), branch = "master", repoType = aoptions("repoType"), format = "markdown", rawLink = FALSE)Arguments
md5hash | A character assigned to the artifact through the use of a cryptographical hash function with MD5 algorithm. If it is specified in a format of |
repo | The Remote |
user | The name of a user on whose |
subdir | A character containing a name of a directory on the Remote repository on which the Repository is stored. If the Repository is stored in the main folder on the Remote repository, this should be set to |
branch | A character containing a name of the Remote Repository's branchon which the Repository is archived. Default |
repoType | A character containing a type of the remote repository. Currently it can be 'github' or 'bitbucket'. |
format | In which format the link should be returned. Possibilities are |
rawLink | A logical denoting whether to return raw link or a link in the |
Details
For more information aboutmd5hash seemd5hash.
Value
This function returns a link to download artifact that is archived on GitHub.
Contact
Bug reports and feature requests can be sent tohttps://github.com/pbiecek/archivist/issues
Author(s)
Marcin Kosinski,m.p.kosinski@gmail.com
See Also
Other archivist:Repository,Tags,%a%(),addHooksToPrint(),addTagsRepo(),aformat(),ahistory(),aoptions(),archivistPackage,aread(),areadLocal(),asearch(),asearchLocal(),asession(),atrace(),cache(),copyLocalRepo(),createLocalRepo(),createMDGallery(),deleteLocalRepo(),getRemoteHook(),getTagsLocal(),loadFromLocalRepo(),md5hash,removeTagsRepo(),restoreLibs(),rmFromLocalRepo(),saveToLocalRepo(),searchInLocalRepo(),setLocalRepo(),shinySearchInLocalRepo(),showLocalRepo(),splitTagsLocal(),summaryLocalRepo(),zipLocalRepo()
Examples
## Not run: # link in markdown formatalink('pbiecek/archivist/134ecbbe2a8814d98f0c2758000c408e')# link in markdown format with additional subdiralink(user='BetaAndBit',repo='PieczaraPietraszki', md5hash = '1569cc44e8450439ac52c11ccac35138', subdir = 'UniwersytetDzieci/arepo')# link in latex formatalink(user = 'MarcinKosinski', repo = 'Museum', md5hash = '1651caa499a2b07a3bdad3896a2fc717', format = 'latex')# link in raw formatalink('pbiecek/graphGallery/f5185c458bff721f0faa8e1332f01e0f', rawLink = TRUE) alink('pbiecek/graphgallerygit/02af4f99e440324b9e329faa293a9394', repoType='bitbucket') ## End(Not run)Default Options for Archivist
Description
The functionaoptions sets and gets default optionsfor otherarchivist functions.
Usage
aoptions(key, value = NULL, unset = FALSE)Arguments
key | A character denoting name of the parameter. |
value | New value for the 'key' parameter. |
unset | Set to |
Details
The functionaoptions with two parameters sets defaultvalue ofkey parameter for otherarchivist functions. The functionaoptions with one parameter returns value (stored in an internal environment))of the givenkey parameter.
Value
The function returns value that corresponds to a selected key.
Contact
Bug reports and feature requests can be sent tohttps://github.com/pbiecek/archivist/issues
Author(s)
Przemyslaw Biecek,przemyslaw.biecek@gmail.com
References
Biecek P and Kosinski M (2017). "archivist: An R Package for Managing,Recording and Restoring Data Analysis Results." _Journal of StatisticalSoftware_, *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(),archivistPackage,aread(),areadLocal(),asearch(),asearchLocal(),asession(),atrace(),cache(),copyLocalRepo(),createLocalRepo(),createMDGallery(),deleteLocalRepo(),getRemoteHook(),getTagsLocal(),loadFromLocalRepo(),md5hash,removeTagsRepo(),restoreLibs(),rmFromLocalRepo(),saveToLocalRepo(),searchInLocalRepo(),setLocalRepo(),shinySearchInLocalRepo(),showLocalRepo(),splitTagsLocal(),summaryLocalRepo(),zipLocalRepo()
Examples
## Not run: # data.frame object# data(iris)## EXAMPLE 1 : SET default local repository using aoptions() function.# creating example repositoryexampleRepoDir <- tempfile()createLocalRepo(exampleRepoDir)# "repodDir" parameter in each archivist function will be default and set to exampleRepoDir.aoptions(key = "repoDir", value = exampleRepoDir)data(iris)data(swiss)# From this moment repoDir parameter may be ommitted in the following functionssaveToLocalRepo(iris)saveToLocalRepo(swiss) showLocalRepo()showLocalRepo(method = "tags")zipLocalRepo()file.remove(file.path(getwd(), "repository.zip"))iris2 <- loadFromLocalRepo( "ff575c2" , value = TRUE)searchInLocalRepo("name:i", fixed = F)getTagsLocal("ff575c261c949d073b2895b05d1097c3")rmFromLocalRepo("4c43f")showLocalRepo()summaryLocalRepo()# REMEMBER that in deleteRepo you MUST specify repoDir parameter!# deleteLocalRepo doesn't take setLocalRepo's settings into considerationdeleteLocalRepo( exampleRepoDir, deleteRoot = TRUE)rm( exampleRepoDir )## EXAMPLE 2 : SET default Github repository using aoptions() function.aoptions(key = "user", value = "pbiecek")aoptions(key = "repo", value = "archivist")# From this moment user and repo parameters may be ommitted in the following functions:showRemoteRepo() loadFromRemoteRepo( "ff575c261c949d073b2895b05d1097c3")this <- loadFromRemoteRepo( "ff", value = T)file.remove(file.path(getwd(), "repository.zip")) # We can remove this zip filesearchInRemoteRepo( "name:", fixed= FALSE)getTagsGithub("ff575c261c949d073b2895b05d1097c3")summaryRemoteRepo( )searchInRemoteRepo( pattern=c("varname:Sepal.Width", "class:lm", "name:myplot123"), intersect = FALSE ) ## EXAMPLE 3 : SET default Github repository using aoptions() function.showRemoteRepo('Museum', 'MarcinKosinski', subdir = 'ex1')aoptions('repo', 'Museum')aoptions('user', 'MarcinKosinski')aoptions('subdir', 'ex1')aoptions('branch', 'master')showRemoteRepo()showRemoteRepo(subdir = 'ex2')aoptions('subdir')## EXAMPLE 4 : SET sha256 as a hasing algorithmaoptions("hashFunction", value = "sha256")exampleRepoDir <- tempfile()createLocalRepo(exampleRepoDir)aoptions(key = "repoDir", value = exampleRepoDir)data(iris)saveToLocalRepo(iris)getTagsLocal(digest::digest(iris, algo = "sha256"))## End(Not run)Read Artifacts Given as md5hashes from the Repository
Description
aread reads the artifact from theRepository. It's a wrapper aroundloadFromLocalRepo andloadFromRemoteRepo.
Usage
aread(md5hash)Arguments
md5hash | One of the following: A character vector which elements are consisting of at least three components separated with '/': Remote user name, Remote repository and name of the artifact (MD5 hash) or it's abbreviation. MD5 hashes of artifacts in current local default directory or its abbreviations. |
Details
Functionaread reads artifacts (bymd5hashes) from Remote Repository.It usesloadFromLocalRepo andloadFromRemoteRepo functionswith different parameter's specification.
Contact
Bug reports and feature requests can be sent tohttps://github.com/pbiecek/archivist/issues
Note
Before you start using this function, remember to set local or Remote repositoryto default by usingsetLocalRepo() orsetRemoteRepo functions.
Author(s)
Przemyslaw Biecek,przemyslaw.biecek@gmail.com
References
Biecek P and Kosinski M (2017). "archivist: An R Package for Managing,Recording and Restoring Data Analysis Results." _Journal of StatisticalSoftware_, *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(),archivistPackage,areadLocal(),asearch(),asearchLocal(),asession(),atrace(),cache(),copyLocalRepo(),createLocalRepo(),createMDGallery(),deleteLocalRepo(),getRemoteHook(),getTagsLocal(),loadFromLocalRepo(),md5hash,removeTagsRepo(),restoreLibs(),rmFromLocalRepo(),saveToLocalRepo(),searchInLocalRepo(),setLocalRepo(),shinySearchInLocalRepo(),showLocalRepo(),splitTagsLocal(),summaryLocalRepo(),zipLocalRepo()
Examples
# read the object from local directorysetLocalRepo(system.file("graphGallery", package = "archivist"))pl <- aread("7f3453331910e3f321ef97d87adb5bad")# To plot it remember to have ggplot2 in version 2.1.0# as this is stated in asession("7f3453331910e3f321ef97d87adb5bad") .# The state of R libraries can be restored to the same state in# which 7f3453331910e3f321ef97d87adb5bad was created with the restoreLibs function.# read the object from Remote# pl <- aread("pbiecek/graphGallery/7f3453331910e3f321ef97d87adb5bad")# To plot it remember to have ggplot2 in version 2.1.0# as this is stated in asession("pbiecek/graphGallery/7f3453331910e3f321ef97d87adb5bad") .# The state of R libraries can be restored to the same state in# which 7f3453331910e3f321ef97d87adb5bad was created with the restoreLibs function.Read Artifacts Given as md5hashes from the Repository
Description
areadLocal reads the artifact from the LocalRepository. It's a wrapper aroundloadFromLocalRepo.
Usage
areadLocal(md5hash, repo)Arguments
md5hash | A character vector which elements are consisting name of the repository and name of the artifact (MD5 hash) or it's abbreviation. |
repo | A character with path to local repository. |
Details
FunctionareadLocal reads artifacts (bymd5hashes) from Local Repository.
Contact
Bug reports and feature requests can be sent tohttps://github.com/pbiecek/archivist/issues
Author(s)
Przemyslaw Biecek,przemyslaw.biecek@gmail.com
References
Biecek P and Kosinski M (2017). "archivist: An R Package for Managing,Recording and Restoring Data Analysis Results." _Journal of StatisticalSoftware_, *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(),archivistPackage,aread(),asearch(),asearchLocal(),asession(),atrace(),cache(),copyLocalRepo(),createLocalRepo(),createMDGallery(),deleteLocalRepo(),getRemoteHook(),getTagsLocal(),loadFromLocalRepo(),md5hash,removeTagsRepo(),restoreLibs(),rmFromLocalRepo(),saveToLocalRepo(),searchInLocalRepo(),setLocalRepo(),shinySearchInLocalRepo(),showLocalRepo(),splitTagsLocal(),summaryLocalRepo(),zipLocalRepo()
Read Artifacts Given as a List of Tags
Description
asearch searches for artifacts that contain all specifiedTagsand reads all of them from a default or RemoteRepository. It's a wrapper aroundsearchInLocalRepo andloadFromLocalRepo and their Remote versions.
Usage
asearch(patterns, repo = NULL)Arguments
patterns | A character vector of |
repo | One of following: A character with Remote user name and Remote repository name separated by '/'. NULL in this case search will be performed in the default repo, either local or Remote |
Details
Functionasearch reads all artifacts that contain given list ofTagsfrom default or Remote Repository.It uses bothloadFromLocalRepo andsearchInLocalRepo functions (or their Remote versions)but has shorter name and different parameter's specification.
Value
This function returns a list of artifacts (by their values).
Contact
Bug reports and feature requests can be sent tohttps://github.com/pbiecek/archivist/issues
Note
Remember that if you want to use local repository you should set it to default.
Author(s)
Przemyslaw Biecek,przemyslaw.biecek@gmail.com
References
Biecek P and Kosinski M (2017). "archivist: An R Package for Managing,Recording and Restoring Data Analysis Results." _Journal of StatisticalSoftware_, *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(),archivistPackage,aread(),areadLocal(),asearchLocal(),asession(),atrace(),cache(),copyLocalRepo(),createLocalRepo(),createMDGallery(),deleteLocalRepo(),getRemoteHook(),getTagsLocal(),loadFromLocalRepo(),md5hash,removeTagsRepo(),restoreLibs(),rmFromLocalRepo(),saveToLocalRepo(),searchInLocalRepo(),setLocalRepo(),shinySearchInLocalRepo(),showLocalRepo(),splitTagsLocal(),summaryLocalRepo(),zipLocalRepo()
Examples
## Not run: ### default LOCAL version## objects preparation# data.frame objectdata(iris)# ggplot/gg objectlibrary(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 objectmodel <- lm(Sepal.Length~ Sepal.Width + Petal.Length + Petal.Width, data= iris)model2 <- lm(Sepal.Length~ Sepal.Width + Petal.Width, data= iris)model3 <- lm(Sepal.Length~ Sepal.Width, data= iris)## creating example default local repositoryexampleRepoDir <- tempfile()createLocalRepo(repoDir = exampleRepoDir)## setting default local repositorysetLocalRepo( repoDir = exampleRepoDir )saveToLocalRepo(myplot123)saveToLocalRepo(iris)saveToLocalRepo(model)saveToLocalRepo(model2)saveToLocalRepo(model3)## Searching for objects of class:lmlm <- asearch(patterns = "class:lm")## Searching for objects of class:lm with coefname:Petal.Widthlm_c_PW <- asearch(patterns = c("class:lm","coefname:Petal.Width"))# Note that we searched for objects. Then loaded them from repository by their value.## deleting example repositorydeleteLocalRepo(repoDir = exampleRepoDir, deleteRoot = TRUE)rm(exampleRepoDir)### default GitHub version## Setting default github repositorysetRemoteRepo( user = "pbiecek", repo = "archivist")showRemoteRepo(method = "tags")$tagsearchInRemoteRepo(pattern = "class:lm")searchInRemoteRepo(pattern = "class:gg")getTagsRemote(md5hash = "cd6557c6163a6f9800f308f343e75e72", tag = "")## Searching for objects of class:lmasearch(patterns = c("class:lm"))## Searching for objects of class:ggggplot_objects <- asearch(patterns = c("class:gg"))# names(ggplot_objects)# To plot them remember to have ggplot2 in version 2.1.0# as this is stated in asession("pbiecek/archivist/13b2724139eb2c62578b4dab0d7b2cea") orasession("pbiecek/archivist/7f3453331910e3f321ef97d87adb5bad") .# The state of R libraries can be restored to the same state in# which those objects were created with the restoreLibs function.### Remote version ## Note that repo argument is passed in the following way to asearch:## repo = "GitHub user name/GitHub repository name"## Searching for objects of class:ggasearch("pbiecek/graphGallery", patterns = c("class:gg", "labelx:Sepal.Length")) -> ggplots_objects_v2## End(Not run)Read Artifacts Given as a List of Tags
Description
asearchLocal searches for artifacts that contain all specifiedTagsand reads all of them from a localRepository. It's a wrapper aroundsearchInLocalRepo andloadFromLocalRepo.
Usage
asearchLocal(patterns, repo = NULL)Arguments
patterns | A character vector of |
repo | A character with path to local repository. |
Details
FunctionasearchLocal reads all artifacts that contain given list ofTagsfrom the selected Local Repository.
Value
This function returns a list of artifacts (by their values).
Contact
Bug reports and feature requests can be sent tohttps://github.com/pbiecek/archivist/issues
Author(s)
Przemyslaw Biecek,przemyslaw.biecek@gmail.com
References
Biecek P and Kosinski M (2017). "archivist: An R Package for Managing,Recording and Restoring Data Analysis Results." _Journal of StatisticalSoftware_, *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(),archivistPackage,aread(),areadLocal(),asearch(),asession(),atrace(),cache(),copyLocalRepo(),createLocalRepo(),createMDGallery(),deleteLocalRepo(),getRemoteHook(),getTagsLocal(),loadFromLocalRepo(),md5hash,removeTagsRepo(),restoreLibs(),rmFromLocalRepo(),saveToLocalRepo(),searchInLocalRepo(),setLocalRepo(),shinySearchInLocalRepo(),showLocalRepo(),splitTagsLocal(),summaryLocalRepo(),zipLocalRepo()
Show Artifact's Session Info
Description
asession extracts artifact's session info. This allows to check in what conditions the artifact was created.
Usage
asession(md5hash = NULL)Arguments
md5hash | One of the following (seearead): A character vector which elements are consisting of at least three components separated with '/': Remote user name, Remote repository and name of the artifact (MD5 hash) or it's abbreviation. MD5 hashes of artifacts in current local default directory or its abbreviations. |
Value
An object of the classsession_info.
Contact
Bug reports and feature requests can be sent tohttps://github.com/pbiecek/archivist/issues
Author(s)
Przemyslaw Biecek,przemyslaw.biecek@gmail.com
References
Biecek P and Kosinski M (2017). "archivist: An R Package for Managing,Recording and Restoring Data Analysis Results." _Journal of StatisticalSoftware_, *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(),archivistPackage,aread(),areadLocal(),asearch(),asearchLocal(),atrace(),cache(),copyLocalRepo(),createLocalRepo(),createMDGallery(),deleteLocalRepo(),getRemoteHook(),getTagsLocal(),loadFromLocalRepo(),md5hash,removeTagsRepo(),restoreLibs(),rmFromLocalRepo(),saveToLocalRepo(),searchInLocalRepo(),setLocalRepo(),shinySearchInLocalRepo(),showLocalRepo(),splitTagsLocal(),summaryLocalRepo(),zipLocalRepo()
Examples
## Not run: setLocalRepo(system.file("graphGallery", package = "archivist"))asession("2a6e492cb6982f230e48cf46023e2e4f")# no session infoasession("pbiecek/graphGallery/2a6e492cb6982f230e48cf46023e2e4f")# nice session infoasession("pbiecek/graphGallery/7f3453331910e3f321ef97d87adb5bad")## End(Not run)Add Tracing For All Objects Created By Given Function
Description
atrace add call tosaveToLocalRepo at the end of a given function.
Usage
atrace(FUN = "lm", object = "z")Arguments
FUN | name of a function to be traced (character) |
object | name of an object that should be traced (character) |
Details
Functionatrace calls thetrace function.
Contact
Bug reports and feature requests can be sent tohttps://github.com/pbiecek/archivist/issues
Author(s)
Przemyslaw Biecek,przemyslaw.biecek@gmail.com
References
Biecek P and Kosinski M (2017). "archivist: An R Package for Managing,Recording and Restoring Data Analysis Results." _Journal of StatisticalSoftware_, *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(),archivistPackage,aread(),areadLocal(),asearch(),asearchLocal(),asession(),cache(),copyLocalRepo(),createLocalRepo(),createMDGallery(),deleteLocalRepo(),getRemoteHook(),getTagsLocal(),loadFromLocalRepo(),md5hash,removeTagsRepo(),restoreLibs(),rmFromLocalRepo(),saveToLocalRepo(),searchInLocalRepo(),setLocalRepo(),shinySearchInLocalRepo(),showLocalRepo(),splitTagsLocal(),summaryLocalRepo(),zipLocalRepo()
Examples
# read the object from local directory## Not run: createLocalRepo("arepo_test", default=TRUE)atrace("lm", "z")lm(Sepal.Length~Sepal.Width, data=iris)asearch("class:lm")untrace("lm")## End(Not run)Enable Caching of the Function Results with the use of Archivist
Description
cache function stores all results of function calls in localRepository.All results are stored together with md5 hashes of the function calls.If a function is called with the same arguments, then its results can be loadedfrom the repository.
One may specify expiration date for live objects. It may be useful for objects that can be changed externally (like queries to database).
Usage
cache(cacheRepo = NULL, FUN, ..., notOlderThan = NULL)Arguments
cacheRepo | A repository used for storing cached objects. |
FUN | A function to be called. |
... | Arguments of |
notOlderThan | load an artifact from the database only if it was created after notOlderThan. |
Details
cache function stores all results of function calls in localRepository specified by thecacheRepo argument.The md5 hash ofFUN and it's arguments is added as a Tag to the repository.This Tag has the following structure "cacheId:md5hash".Note thatcache is a good solution if objects are not that big but calculationsare time consuming (seeExamples). If objects are big and calculations are easy, thendisk input-output operations may take more time than calculations itself.
Value
Result of the function call with additional attributes:tags - md5 hash of thefunction call andcall - "".
Contact
Bug reports and feature requests can be sent tohttps://github.com/pbiecek/archivist/issues
Author(s)
Przemyslaw Biecek,Przemyslaw.Biecek@gmail.com
References
Biecek P and Kosinski M (2017). "archivist: An R Package for Managing,Recording and Restoring Data Analysis Results." _Journal of StatisticalSoftware_, *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
For more detailed information, check thearchivist packageUse Cases.
Other archivist:Repository,Tags,%a%(),addHooksToPrint(),addTagsRepo(),aformat(),ahistory(),alink(),aoptions(),archivistPackage,aread(),areadLocal(),asearch(),asearchLocal(),asession(),atrace(),copyLocalRepo(),createLocalRepo(),createMDGallery(),deleteLocalRepo(),getRemoteHook(),getTagsLocal(),loadFromLocalRepo(),md5hash,removeTagsRepo(),restoreLibs(),rmFromLocalRepo(),saveToLocalRepo(),searchInLocalRepo(),setLocalRepo(),shinySearchInLocalRepo(),showLocalRepo(),splitTagsLocal(),summaryLocalRepo(),zipLocalRepo()
Examples
## Not run: # objects preparationlibrary("lubridate")cacheRepo <- tempfile()createLocalRepo( cacheRepo )## Example 1:# cache is useful when objects used by FUN are not that big but calculations# are time-comsuming. Take a look at this example:fun <- function(n) {replicate(n, summary(lm(Sepal.Length~Species, iris))$r.squared)}# let's check time of two evaluations of cache functionsystem.time( res <- cache(cacheRepo, fun, 1000) )system.time( res <- cache(cacheRepo, fun, 1000) ) # The second call is much faster. Why is it so? Because the result of fun# function evaluation has been stored in local cacheRepo during the first evaluation# of cache. In the second call of cache we are simply loading the result of fun# from local cacheRepo Repository.## Example 2:testFun <- function(x) {cat(x);x}# testFun will be executed and saved to cacheRepotmp <- cache(cacheRepo, testFun, "Say hallo!")# testFun execution will be loaded from repositorytmp <- cache(cacheRepo, testFun, "Say hallo!")# testFun will be executed once again as it fails with expiration date. It will# be saved to cacheRepo.tmp <- cache(cacheRepo, testFun, "Say hallo!", notOlderThan = now())# testFun execution will be loaded from repository as it# passes with expiration date [within hour]tmp <- cache(cacheRepo, testFun, "Say hallo!", notOlderThan = now() - hours(1))deleteLocalRepo( cacheRepo, TRUE)rm( cacheRepo )## End(Not run)Copy an Existing Repository into Another Repository
Description
copy*Repo copies artifacts from oneRepository into anotherRepository.It adds new files to existinggallery folder inrepoToRepository.copyLocalRepo copies localRepository whilecopyRemoteRepo copiesremoteRepository.
Usage
copyLocalRepo(repoFrom = NULL, repoTo, md5hashes)copyRemoteRepo( repoTo, md5hashes, repo = aoptions("repo"), user = aoptions("user"), branch = aoptions("branch"), subdir = aoptions("subdir"), repoType = aoptions("repoType"))Arguments
repoFrom | While copying local repository. A character that specifiesthe directory of the Repository from whichartifacts will be copied. If it is set to |
repoTo | A character that specifies the directory of the Repository into whichartifacts will be copied. |
md5hashes | A character vector containing |
repo | While coping the remote repository. A character containing a name of theremote repository on which the " |
user | While coping the remote repository. A character containing a nameof the remote user on whose account the " |
branch | While coping with the remote repository. A character containing a name of Remote Repository's branch on which the " |
subdir | While working with the remote repository. A character containing a name ofa directory on the remote repository on which the " |
repoType | A character containing a type of the remote repository. Currently it can be 'Remote' or 'bitbucket'. |
Details
FunctionscopyLocalRepo andcopyRemoteRepo copy artifacts from thearchivist's Repositories stored in a local folder or on the Remote. Both of them usemd5hashes of artifacts which are to be copied inmd5hashes parameter. For more information aboutmd5hash seemd5hash.
Contact
Bug reports and feature requests can be sent tohttps://github.com/pbiecek/archivist/issues
Note
Ifrepo anduser are set toNULL (as default) in remote mode then global parametersset insetRemoteRepo function are used. If one would like to copy whole Repository we suggest to extract allmd5hashes in this wayunique(showLocalRepo(repoDir)[,1]).
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 StatisticalSoftware_, *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(),archivistPackage,aread(),areadLocal(),asearch(),asearchLocal(),asession(),atrace(),cache(),createLocalRepo(),createMDGallery(),deleteLocalRepo(),getRemoteHook(),getTagsLocal(),loadFromLocalRepo(),md5hash,removeTagsRepo(),restoreLibs(),rmFromLocalRepo(),saveToLocalRepo(),searchInLocalRepo(),setLocalRepo(),shinySearchInLocalRepo(),showLocalRepo(),splitTagsLocal(),summaryLocalRepo(),zipLocalRepo()
Examples
## Not run: ## Using archivist remote Repository to copy artifacts# creating example Repository exampleRepoDir <- tempfile()createLocalRepo( exampleRepoDir )# Searching for md5hashes of artifacts (without data related to them)# in the archivist remote Repositoryhashes <- searchInRemoteRepo( pattern="name", user="pbiecek", repo="archivist", fixed=FALSE )# Copying selected artifacts from archivist Remote Repository into exampleRepoDir RepositorycopyRemoteRepo( repoTo = exampleRepoDir , md5hashes= hashes, user="pbiecek", repo="archivist" )# See how the gallery folder in our exampleRepoDir Repository# with copies of artifacts from archivist Remote Repository looks likelist.files( path = file.path( exampleRepoDir, "gallery" ) )# See how the backpack database in our exampleRepoDir Repository looks likeshowLocalRepo( repoDir = exampleRepoDir )# removing an example RepositorydeleteLocalRepo( exampleRepoDir, deleteRoot=TRUE )rm( exampleRepoDir )# many archivist-like Repositories on one Remote repositorydir <- paste0(getwd(), "/ex1")createLocalRepo( dir )copyRemoteRepo( repoTo = dir , md5hashes = "ff575c261c949d073b2895b05d1097c3", user="MarcinKosinski", repo="Museum", branch="master", subdir="ex2") # Check if the copied artifact is on our dir RepositoryshowLocalRepo( repoDir = dir) # It is in backpack database indeedlist.files( path = file.path( dir, "gallery" ) ) # it is also in gallery folder# removing an example RepositorydeleteLocalRepo( dir, TRUE)rm(dir)## Using graphGallery Repository attached to the archivist package to copy artifacts# creating example RepositoryexampleRepoDir <- tempfile()createLocalRepo( exampleRepoDir )# Searching for md5hashes of artifacts (without data related to them)# in the graphGallery RepositoryarchivistRepo <- system.file( "graphGallery", package = "archivist")# You may use: # hashes <- unique(showLocalRepo(repoDir)[,1]) # to extract all artifacts from repositoryhashes <- searchInLocalRepo( pattern="name", repoDir = archivistRepo, fixed=FALSE )# Copying selected artifacts from archivist Remote Repository into exampleRepoDir RepositorycopyLocalRepo( repoFrom = archivistRepo, repoTo = exampleRepoDir , md5hashes= hashes )# See how the backpack database in our exampleRepoDir Repository looks likeshowLocalRepo( repoDir = exampleRepoDir )# removing an example RepositorydeleteLocalRepo( exampleRepoDir, deleteRoot=TRUE )rm( exampleRepoDir )rm( archivistRepo )## End(Not run)Create an Empty Repository
Description
createLocalRepo creates an emptyRepository in the given directory in which archived artifacts will be stored.
Usage
createLocalRepo(repoDir, force = FALSE, default = FALSE)createPostgresRepo(repoDir, connector, force = FALSE, default = FALSE)createEmptyRepo(...)Arguments
repoDir | A character that specifies the directory for the Repository which is to be made. |
force | If |
default | If |
connector | If user want to use some external database instead of SQLite, then the |
... | All arguments are being passed to |
Details
At least one Repository must be initialized before using other functions from thearchivist package. While working in groups, it is highly recommended to create a Repository on a shared Dropbox/GitHub folder.
All artifacts which are desired to be archived are going to be saved in the local Repository, which is an SQLite database stored in a file namedbackpack. After callingsaveToRepo function, each artifact will be archived in amd5hash.rda file. This file will be saved in a folder (underrepoDir directory) namedgallery. For every artifact,md5hash is a unique string of length 32 that is produced bydigest function, which uses a cryptographical MD5 hash algorithm.
To learn more about artifacts visitarchivistPackage.
Createdbackpack database is a useful and fundamental tool for remembering artifact'sname,class,archiving date etc. (the so calledTags)or for keeping artifact'smd5hash.
Besides thebackpack database,gallery folder is created in which all artifacts will be archived.
After everysaveToRepo call the database is refreshed. As a result, the artifact is available immediately inbackpack.db database for other collaborators.
Contact
Bug reports and feature requests can be sent tohttps://github.com/pbiecek/archivist/issues
Author(s)
Marcin Kosinski,m.p.kosinski@gmail.comPrzemyslaw Biecek,przemyslaw.biecek@gmail.com
References
Biecek P and Kosinski M (2017). "archivist: An R Package for Managing,Recording and Restoring Data Analysis Results." _Journal of StatisticalSoftware_, *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(),archivistPackage,aread(),areadLocal(),asearch(),asearchLocal(),asession(),atrace(),cache(),copyLocalRepo(),createMDGallery(),deleteLocalRepo(),getRemoteHook(),getTagsLocal(),loadFromLocalRepo(),md5hash,removeTagsRepo(),restoreLibs(),rmFromLocalRepo(),saveToLocalRepo(),searchInLocalRepo(),setLocalRepo(),shinySearchInLocalRepo(),showLocalRepo(),splitTagsLocal(),summaryLocalRepo(),zipLocalRepo()
Other archivist:Repository,Tags,%a%(),addHooksToPrint(),addTagsRepo(),aformat(),ahistory(),alink(),aoptions(),archivistPackage,aread(),areadLocal(),asearch(),asearchLocal(),asession(),atrace(),cache(),copyLocalRepo(),createMDGallery(),deleteLocalRepo(),getRemoteHook(),getTagsLocal(),loadFromLocalRepo(),md5hash,removeTagsRepo(),restoreLibs(),rmFromLocalRepo(),saveToLocalRepo(),searchInLocalRepo(),setLocalRepo(),shinySearchInLocalRepo(),showLocalRepo(),splitTagsLocal(),summaryLocalRepo(),zipLocalRepo()
Other archivist:Repository,Tags,%a%(),addHooksToPrint(),addTagsRepo(),aformat(),ahistory(),alink(),aoptions(),archivistPackage,aread(),areadLocal(),asearch(),asearchLocal(),asession(),atrace(),cache(),copyLocalRepo(),createMDGallery(),deleteLocalRepo(),getRemoteHook(),getTagsLocal(),loadFromLocalRepo(),md5hash,removeTagsRepo(),restoreLibs(),rmFromLocalRepo(),saveToLocalRepo(),searchInLocalRepo(),setLocalRepo(),shinySearchInLocalRepo(),showLocalRepo(),splitTagsLocal(),summaryLocalRepo(),zipLocalRepo()
Examples
## Not run: exampleRepoDir <- tempfile()createLocalRepo( repoDir = exampleRepoDir, default = TRUE )data(iris)saveToLocalRepo(iris)showLocalRepo()showLocalRepo(method = "tags")deleteLocalRepo( repoDir = exampleRepoDir, unset = TRUE, deleteRoot = TRUE)# example with external database# create a connectorrequire("RPostgreSQL")drv <- dbDriver("PostgreSQL")connector <- function() { dbConnect(drv, dbname = "postgres", host = "localhost", port = 5432, user = "user", password = pw)}# Now you can create an empty repository with postgress databaseexampleRepoDir <- tempfile()createPostgresRepo( repoDir = exampleRepoDir, connector)data(iris)saveToLocalRepo(iris)showLocalRepo()showLocalRepo(method = "tags")deleteLocalRepo( repoDir = exampleRepoDir, unset = TRUE, deleteRoot = TRUE)## End(Not run)Create the Summary for Each Artifact in a Markdown Format
Description
createMDGallery creates a summary for each artifact fromRepository stored on a GitHub.For each artifact this function creates a markdown file with: the download link, artifact'sTags (whenaddTags = TRUE) andminiature (addMiniature = TRUE) if the artifact was archived with it's miniature andTags. The miniature is aprintorhead over an artifact or it'spng when it was a plot. But this function only supportspng miniatures.
Usage
createMDGallery( output, repo = aoptions("repo"), user = aoptions("user"), branch = aoptions("branch"), subdir = aoptions("subdir"), repoType = aoptions("repoType"), addTags = FALSE, addMiniature = FALSE, maxTags = 100)Arguments
output | A name of the file in which artifacts should be summarized. |
repo | A character containing a name of the Remote repository on which the Repository is stored.By default set to |
user | A character containing a name of the Github user on whose account the |
branch | A character containing a name ofthe Remote Repository's branch on which the Repository is stored. Default |
subdir | A character containing a name of a directory on the Remote repositoryon which the Repository is stored. If the Repository is stored in the main folder of the Remote repository, this should be setto |
repoType | A character containing a type of the remote repository. Currently it can be 'github' or 'bitbucket'. |
addTags | Logical, whether to add artifact'sTags to the |
addMiniature | Logical, whether to add artifact's |
maxTags | Integer. The maximal length of chunks output when describing |
Details
To learn more about artifacts visitarchivistPackage.
Contact
Bug reports and feature requests can be sent tohttps://github.com/pbiecek/archivist/issues
Note
Ifrepo anduser are set toNULL (as default) in the Remote mode then global parametersset insetRemoteRepo (or viaaoptions) 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 StatisticalSoftware_, *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
Markdown example:https://github.com/pbiecek/archivist/issues/144#issuecomment-174192366
Other archivist:Repository,Tags,%a%(),addHooksToPrint(),addTagsRepo(),aformat(),ahistory(),alink(),aoptions(),archivistPackage,aread(),areadLocal(),asearch(),asearchLocal(),asession(),atrace(),cache(),copyLocalRepo(),createLocalRepo(),deleteLocalRepo(),getRemoteHook(),getTagsLocal(),loadFromLocalRepo(),md5hash,removeTagsRepo(),restoreLibs(),rmFromLocalRepo(),saveToLocalRepo(),searchInLocalRepo(),setLocalRepo(),shinySearchInLocalRepo(),showLocalRepo(),splitTagsLocal(),summaryLocalRepo(),zipLocalRepo()
Examples
## Not run: createMDGallery(user = 'MarcinKosinski', repo = 'Museum', 'README_test1.md', addTags = TRUE)createMDGallery('graphGallery', 'pbiecek', addMiniature = TRUE, 'README_test2.md', addTags = TRUE)## End(Not run)Delete the Existing Repository from the Given Directory
Description
deleteLocalRepo deletes the existingRepository from the given directory.As a result all artifacts fromgallery folder are removed and databasebackpack.dbis deleted.
Usage
deleteLocalRepo(repoDir, deleteRoot = FALSE, unset = FALSE)deleteRepo(...)Arguments
repoDir | A character that specifies the directory for the Repositorywhich is to be deleted. |
deleteRoot | A logical value that specifies if the repository root directoryshould be deleted for Local Repository. |
unset | A logical. If deleted |
... | All arguments are being passed to |
Contact
Bug reports and feature requests can be sent tohttps://github.com/pbiecek/archivist/issues
Note
Remember that usingtempfile() instead oftempdir()in examples section is crucial.tempdir() is existing directoryin which R works so callingdeleteLocalRepo(exampleRepoDir, deleteRoot=TRUE)removes important R files. You can find out more information about this problem atstackoverflowwebpage.
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 StatisticalSoftware_, *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(),archivistPackage,aread(),areadLocal(),asearch(),asearchLocal(),asession(),atrace(),cache(),copyLocalRepo(),createLocalRepo(),createMDGallery(),getRemoteHook(),getTagsLocal(),loadFromLocalRepo(),md5hash,removeTagsRepo(),restoreLibs(),rmFromLocalRepo(),saveToLocalRepo(),searchInLocalRepo(),setLocalRepo(),shinySearchInLocalRepo(),showLocalRepo(),splitTagsLocal(),summaryLocalRepo(),zipLocalRepo()
Other archivist:Repository,Tags,%a%(),addHooksToPrint(),addTagsRepo(),aformat(),ahistory(),alink(),aoptions(),archivistPackage,aread(),areadLocal(),asearch(),asearchLocal(),asession(),atrace(),cache(),copyLocalRepo(),createLocalRepo(),createMDGallery(),getRemoteHook(),getTagsLocal(),loadFromLocalRepo(),md5hash,removeTagsRepo(),restoreLibs(),rmFromLocalRepo(),saveToLocalRepo(),searchInLocalRepo(),setLocalRepo(),shinySearchInLocalRepo(),showLocalRepo(),splitTagsLocal(),summaryLocalRepo(),zipLocalRepo()
Examples
## Not run: exampleRepoDir <- tempfile()createLocalRepo( repoDir = exampleRepoDir, default = TRUE )data(iris)saveToLocalRepo(iris)deleteLocalRepo( repoDir = exampleRepoDir, unset = TRUE, deleteRoot = TRUE)## End(Not run)Internal function for extraction of data from objects
Description
Internal function for extraction of data from objects
Usage
extractData(object, parrentMd5hash, parentDir, isForce, ASCII)## Default S3 method:extractData(object, parrentMd5hash, parentDir, isForce, ASCII)## S3 method for class 'ggplot'extractData(object, parrentMd5hash, parentDir, isForce, ASCII)## S3 method for class 'lm'extractData(object, parrentMd5hash, parentDir, isForce, ASCII)## S3 method for class 'htest'extractData(object, parrentMd5hash, parentDir, isForce, ASCII)## S3 method for class 'lda'extractData(object, parrentMd5hash, parentDir, isForce, ASCII)## S3 method for class 'trellis'extractData(object, parrentMd5hash, parentDir, isForce, ASCII)## S3 method for class 'twins'extractData(object, parrentMd5hash, parentDir, isForce, ASCII)## S3 method for class 'partition'extractData(object, parrentMd5hash, parentDir, isForce, ASCII)## S3 method for class 'qda'extractData(object, parrentMd5hash, parentDir, isForce, ASCII)## S3 method for class 'glmnet'extractData(object, parrentMd5hash, parentDir, isForce, ASCII)## S3 method for class 'survfit'extractData(object, parrentMd5hash, parentDir, isForce, ASCII)Arguments
object | for this object data is to be extracted |
parrentMd5hash | hash of the parent object |
parentDir | parent dir |
isForce | should the data extraction be forced |
ASCII | shall it be written in ASCII friendly format |
Value
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
Internal function for extraction of miniatures
Description
Internal function for extraction of miniatures
Usage
extractMiniature(object, md5hash, parentDir, ...)## Default S3 method:extractMiniature(object, md5hash, parentDir, ...)## S3 method for class 'data.frame'extractMiniature(object, md5hash, parentDir, ..., firstRows = 6)## S3 method for class 'ggplot'extractMiniature(object, md5hash, parentDir, ..., width = 800, height = 600)## S3 method for class 'recordedplot'extractMiniature(object, md5hash, parentDir, ..., width = 800, height = 600)## S3 method for class 'lm'extractMiniature(object, md5hash, parentDir, ...)## S3 method for class 'htest'extractMiniature(object, md5hash, parentDir, ...)## S3 method for class 'trellis'extractMiniature(object, md5hash, parentDir, ..., width = 800, height = 600)## S3 method for class 'twins'extractMiniature(object, md5hash, parentDir, ..., width = 800, height = 600)## S3 method for class 'partition'extractMiniature(object, md5hash, parentDir, ..., width = 800, height = 600)## S3 method for class 'lda'extractMiniature(object, md5hash, parentDir, ...)## S3 method for class 'qda'extractMiniature(object, md5hash, parentDir, ...)## S3 method for class 'glmnet'extractMiniature(object, md5hash, parentDir, ...)## S3 method for class 'survfit'extractMiniature(object, md5hash, parentDir, ...)Arguments
object | for this object miniatures are extracted |
md5hash | hash of the object |
parentDir | parent dir |
... | other arguments |
firstRows | what to present in the miniature |
width | how large should be the miniature? |
height | how large should be the miniature? |
Value
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
Internal function for extraction of tags from objects
Description
Internal function for extraction of tags from objects
Usage
extractTags(object, objectNameX, ...)## Default S3 method:extractTags(object, objectNameX, ...)## S3 method for class 'data.frame'extractTags(object, objectNameX, ...)## S3 method for class 'ggplot'extractTags(object, objectNameX, ...)## S3 method for class 'trellis'extractTags(object, objectNameX, ...)## S3 method for class 'lm'extractTags(object, objectNameX, ...)## S3 method for class 'summary.lm'extractTags(object, objectNameX, ...)## S3 method for class 'htest'extractTags(object, objectNameX, ...)## S3 method for class 'lda'extractTags(object, objectNameX, ...)## S3 method for class 'qda'extractTags(object, objectNameX, ...)## S3 method for class 'twins'extractTags(object, objectNameX, ...)## S3 method for class 'partition'extractTags(object, objectNameX, ...)## S3 method for class 'glmnet'extractTags(object, objectNameX, ...)## S3 method for class 'survfit'extractTags(object, objectNameX, ...)Arguments
object | for this object tags are to be |
objectNameX | name of the object |
... | other arguments |
Value
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
NULL
Get http Hook for Remote Repo
Description
getRemoteHook returns http address of the remoteRepository.Then it can be used to download artifacts from the remoteRepository.
Usage
getRemoteHook( repo = aoptions("repo"), user = aoptions("user"), branch = aoptions("branch"), subdir = aoptions("subdir"), repoType = aoptions("repoType"))Arguments
repo | A character containing a name of a Git repository on which the Repository is archived. |
user | A character containing a name of a Git user on whose account the |
branch | A character containing a name of Git Repository's branch on which the Repository is archived. Default |
subdir | A character containing a name of a directory on Git repository on which the Repository is stored. If the Repository is stored in main folder on Git repository, this should be set to |
repoType | A character containing a type of the remote repository. Currently it can be 'github' or 'bitbucket'. |
Contact
Bug reports and feature requests can be sent tohttps://github.com/pbiecek/archivist/issues
Author(s)
Przemyslaw Biecek,przemyslaw.biecek@gmail.com
See Also
Other archivist:Repository,Tags,%a%(),addHooksToPrint(),addTagsRepo(),aformat(),ahistory(),alink(),aoptions(),archivistPackage,aread(),areadLocal(),asearch(),asearchLocal(),asession(),atrace(),cache(),copyLocalRepo(),createLocalRepo(),createMDGallery(),deleteLocalRepo(),getTagsLocal(),loadFromLocalRepo(),md5hash,removeTagsRepo(),restoreLibs(),rmFromLocalRepo(),saveToLocalRepo(),searchInLocalRepo(),setLocalRepo(),shinySearchInLocalRepo(),showLocalRepo(),splitTagsLocal(),summaryLocalRepo(),zipLocalRepo()
Examples
## Not run: # objects preparationgetRemoteHook("graphGallery", "pbiecek")## End(Not run)Return Tags Corresponding to md5hash
Description
getTagsLocal andgetTagsRemote returnTags (seeTags)related tomd5hash of an artifact. To learn more about artifacts visitarchivistPackage.
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 |
repoDir | A character denoting an existing directory in which artifacts are stored. |
tag | A regular expression denoting type of a |
repo | While working with the Remote repository. A character containinga name of the Remote repository on which the Repository is stored.By default set to |
user | While working with the Remote repository. A character containinga name of the Remote user on whose account the |
branch | While working with the Remote repository. A character containinga name of the Remote repository's branch on which the Repository is stored.Default |
subdir | While working with the Remote repository. A character containinga 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 |
repoType | A character containing a type of the remote repository. Currently it can be 'github' or 'bitbucket'. |
Details
getTagsLocal andgetTagsRemote returnTags, of a specific type describedbytag parameter, related tomd5hash of an artifact. To learn more about artifacts visitarchivistPackage.
Value
The character vector ofTags (seeTags) related tomd5hash of an artifact.
Contact
Bug reports and feature requests can be sent tohttps://github.com/pbiecek/archivist/issues
Note
Ifrepo anduser are set toNULL (as default) in Remote mode then global parametersset insetRemoteRepo 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 StatisticalSoftware_, *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(),archivistPackage,aread(),areadLocal(),asearch(),asearchLocal(),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(),archivistPackage,aread(),areadLocal(),asearch(),asearchLocal(),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 repositoryexampleRepoDir <- 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 respositorydeleteLocalRepo( exampleRepoDir, TRUE) rm( exampleRepoDir ) ## EXAMPLE with data irisexampleRepoDir <- 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 ithash <- 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 GitHubshowRemoteRepo(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)Load Artifact Given as a md5hash from a Repository
Description
loadFromLocalRepo loads an artifact from a localRepository into the workspace.loadFromRemoteRepo loads an artifact from a github / git / mercurialRepository into the workspace.To learn more about artifacts visitarchivistPackage.
Usage
loadFromLocalRepo(md5hash, repoDir = aoptions("repoDir"), value = FALSE)loadFromRemoteRepo( md5hash, repo = aoptions("repo"), user = aoptions("user"), branch = aoptions("branch"), subdir = aoptions("subdir"), repoType = aoptions("repoType"), value = FALSE)Arguments
md5hash | A character assigned to the artifact through the use of a cryptographical hash function with MD5 algorithm, or it's abbreviation. |
repoDir | A character denoting an existing directory from which an artifact will be loaded. |
value | If |
repo | While working with a Remote repository. A character containing a name of a Remote repository on which the Repository is archived.By default set to |
user | While working with a Remote repository. A character containing a name of a Remote user on whose account the |
branch | While working with a Remote repository. A character containing a name of Remote Repository's branch on which the Repository is archived. Default |
subdir | While working with a Remote repository. A character containing a name of a directory on Remote repository on which the Repository is stored. If the Repository is stored in main folder on Remote repository, this should be set to |
repoType | A character containing a type of the remote repository. Currently it can be 'Remote' or 'bitbucket'. |
Details
FunctionsloadFromLocalRepo andloadFromRemoteRepo load artifacts from the archivist Repositories stored in a local folder or on git. Both of them takemd5hash as aparameter, which is a result ofsaveToRepo function.For each artifact,md5hash is a unique string of length 32 that is produced bydigest function, which uses a cryptographical MD5 hash algorithm. For more information seemd5hash.
Important: instead of giving the wholemd5hash character, the user can simply give first few characters of themd5hash.For example,a09dd instead ofa09ddjdkf9kj33dcjdnfjgos9jd9jkcv. All artifacts with the samemd5hash abbreviation will be loaded fromRepository.
Note thatuser andrepo should be used only when working with a git repository and should be omitted in the local mode.repoDir should only be used when working on a local Repository and should be omitted in the git mode.
One may notice thatloadFromRemoteRepo andloadFromLocalRepo load artifacts to the GlobalEnvironment with their original names. Alternatively,a parametervalue = TRUE can be specified so that these functions may return artifacts as a value. As a result loaded artifactscan be attributed to new names. Note that, when an abbreviation ofmd5hash was given then a list of artifacts corresponding to thisabbreviation will be loaded.
Contact
Bug reports and feature requests can be sent tohttps://github.com/pbiecek/archivist/issues
Note
You can specify onemd5hash (or its abbreviation) per function call.
Ifrepo anduser are set toNULL (as default) in Remote mode then global parametersset insetRemoteRepo function are used.
You should remember while usingloadFromRepo wrapper thatrepoDir isa parameter used only inloadFromLocalRepo whilerepo,user,branch andsubdir are used only inloadFromRemoteRepo. When you mix thoseparameters you will receive an error message.
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 StatisticalSoftware_, *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(),archivistPackage,aread(),areadLocal(),asearch(),asearchLocal(),asession(),atrace(),cache(),copyLocalRepo(),createLocalRepo(),createMDGallery(),deleteLocalRepo(),getRemoteHook(),getTagsLocal(),md5hash,removeTagsRepo(),restoreLibs(),rmFromLocalRepo(),saveToLocalRepo(),searchInLocalRepo(),setLocalRepo(),shinySearchInLocalRepo(),showLocalRepo(),splitTagsLocal(),summaryLocalRepo(),zipLocalRepo()
Examples
## Not run: # objects preparation#' exampleRepoDir <- tempfile()createLocalRepo(repoDir = exampleRepoDir)data(iris)saveToLocalRepo(iris, repoDir=exampleRepoDir, archiveSessionInfo = TRUE)showLocalRepo(method = "md5hashes", repoDir = exampleRepoDir)showLocalRepo(method = "tags", repoDir = exampleRepoDir)loadFromLocalRepo(md5hash = '7f3453331910e3f321ef97d87adb5bad', repoDir = system.file("graphGallery", package = "archivist"), value = TRUE) -> pldeleteLocalRepo(exampleRepoDir, TRUE)rm(exampleRepoDir)##Remote Version## check the state of the RepositorysummaryRemoteRepo( user="pbiecek", repo="archivist" )showRemoteRepo( user="pbiecek", repo="archivist" )showRemoteRepo( user="pbiecek", repo="archivist", method = "tags" )rm( model )rm( myplot123 )rm( qda1 )(VARmd5hash <- searchInRemoteRepo( "varname:Sepal.Width", user="pbiecek", repo="archivist" ))(NAMEmd5hash <- searchInRemoteRepo( "name:qda1", user="pbiecek", repo="archivist", branch="master" ))(CLASSmd5hash <- searchInRemoteRepo( "class:ggplot", user="pbiecek", repo="archivist", branch="master" ))loadFromRemoteRepo( "ff575c261c", user="pbiecek", repo="archivist")NewObjects <- loadFromRemoteRepo( NAMEmd5hash, user="pbiecek", repo="archivist", value = TRUE )loadFromRemoteRepo( CLASSmd5hash, user="pbiecek", repo="archivist")## Loading artifacts from the repository which is built in the archivist package ## and saving them on the example repository# Creating an example Repository - on which artifacts loaded from the# archivist package repository will be savedexampleRepoDir <- tempfile()createLocalRepo(repoDir = exampleRepoDir)# Directory of the archivist package repositoryrepo_archivist <- system.file("graphGallery", package = "archivist") # We are checking what kind of objects# are stored in the archivist package repositorysummaryLocalRepo(repoDir = repo_archivist)# Let's say that we are interested in # an artifact of class ggplot.GGPLOTmd5hash <- searchInLocalRepo(pattern = "class:ggplot", repoDir = repo_archivist) # There are eight of them.# We load the first one by its value (parameter value = TRUE)# and assign it to the p variable.p <- loadFromLocalRepo(GGPLOTmd5hash[1], repoDir = repo_archivist, value = TRUE)# Finally, we may save the artifact on the example Repository.# Note that md5hash is different from the one which is stored in# the archivist package repository.saveToRepo(p, repoDir = exampleRepoDir) # Making sure that the artifact is stored on the example repositoryshowLocalRepo(repoDir = exampleRepoDir, method = "tags")# removing an example RepositorydeleteLocalRepo( exampleRepoDir, TRUE)rm( exampleRepoDir )# many archivist-like Repositories on one Remote repositoryloadFromRemoteRepo( "ff575c261c949d073b2895b05d1097c3", user="MarcinKosinski", repo="Museum", branch="master", subdir="ex2")loadFromRemoteRepo( "ff575c261c949d073b2895b05d1097c3", user="MarcinKosinski", repo="Museum", branch="master", subdir="ex1") #githubloadFromRemoteRepo(md5hash = "08dc0b66975cded92b5cd8291ebdc955", repo = "graphGallery", user = "pbiecek", repoType = "github", value = TRUE) #gitloadFromRemoteRepo(md5hash = "08dc0b66975cded92b5cd8291ebdc955", repo = "graphGalleryGit", user = "pbiecek", repoType = "bitbucket", value = TRUE)# mercurial loadFromRemoteRepo(md5hash = "08dc0b66975cded92b5cd8291ebdc955", repo = "graphGalleryM", user = "pbiecek", repoType = "bitbucket", value = TRUE)## End(Not run)md5hash
Description
Repository stores specific values of an artifact, different for various artifact's classes, and artifact themselves. Artifacts are archived witha special attribute namedmd5hash.To learn more about artifacts visitarchivistPackage.
Details
For each artifact,md5hash is a unique string of length 32 that is produced bydigest function which uses a cryptographical MD5 hash algorithm.Themd5hash of each artifact that is archived in theRepository is also savedon the Repository along with the artifact'sTags - seeTags. It enables to distinguishartifacts in the Repository and facilitates searching and loading them.
Contact
Bug reports and feature requests can be sent tohttps://github.com/pbiecek/archivist/issues
References
Biecek P and Kosinski M (2017). "archivist: An R Package for Managing,Recording and Restoring Data Analysis Results." _Journal of StatisticalSoftware_, *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
Functions that takemd5hash as a parameter are:
Functions returningmd5hash as a value are:
Functions returningmd5hashes as adata.frame are:
Learn more aboutmd5hashes atarchivistwiki webpage onGithub.
Other archivist:Repository,Tags,%a%(),addHooksToPrint(),addTagsRepo(),aformat(),ahistory(),alink(),aoptions(),archivistPackage,aread(),areadLocal(),asearch(),asearchLocal(),asession(),atrace(),cache(),copyLocalRepo(),createLocalRepo(),createMDGallery(),deleteLocalRepo(),getRemoteHook(),getTagsLocal(),loadFromLocalRepo(),removeTagsRepo(),restoreLibs(),rmFromLocalRepo(),saveToLocalRepo(),searchInLocalRepo(),setLocalRepo(),shinySearchInLocalRepo(),showLocalRepo(),splitTagsLocal(),summaryLocalRepo(),zipLocalRepo()
Remove Tags from Repository
Description
removeTagsRepo removes selectedTags from selected objects inRepository.
Usage
removeTagsRepo(md5hashes, repoDir = NULL, tags = NULL)Arguments
md5hashes | a character vector of |
repoDir | A character that specifies the directory of the Repository to whichnew |
tags | A character vector which specifies what Tags should be removed. |
Details
removeTagsRepo function removes all Tags from all listed objects.Note that some hashes are required for keeping relations between objects in the repository.Be careful what are you removing.
Contact
Bug reports and feature requests can be sent tohttps://github.com/pbiecek/archivist/issues
Author(s)
Przemyslaw Biecek,przemyslaw.biecek@gmail.com
References
Biecek P and Kosinski M (2017). "archivist: An R Package for Managing,Recording and Restoring Data Analysis Results." _Journal of StatisticalSoftware_, *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(),archivistPackage,aread(),areadLocal(),asearch(),asearchLocal(),asession(),atrace(),cache(),copyLocalRepo(),createLocalRepo(),createMDGallery(),deleteLocalRepo(),getRemoteHook(),getTagsLocal(),loadFromLocalRepo(),md5hash,restoreLibs(),rmFromLocalRepo(),saveToLocalRepo(),searchInLocalRepo(),setLocalRepo(),shinySearchInLocalRepo(),showLocalRepo(),splitTagsLocal(),summaryLocalRepo(),zipLocalRepo()
Examples
## Not run: # Creating empty repositoryexampleRepoDir <- tempfile()createLocalRepo(exampleRepoDir, force=TRUE)# Saving lm artifacts into repositorym1 <- lm(Sepal.Length~Species, iris)saveToLocalRepo(m1, exampleRepoDir)# We may see what kind of Tags are related to "m1" artifact corresponding togetTagsLocal("9e66edd297c2f291446f3503c01d443a", exampleRepoDir, "")# One more look at our ReporemoveTagsRepo("9e66edd297c2f291446f3503c01d443a", exampleRepoDir, tags = "rank:3")# Deleting example repositorydeleteLocalRepo(exampleRepoDir, deleteRoot=TRUE)rm(exampleRepoDir)## End(Not run)Restore Versions of Libraries
Description
Function restoreLibs gets eithersession info or artifact'smd5hash and restore libraries/packages to versions attached when the object was saved in the repo. Typical use case is following. We have saved an object and now we are restoring it, butwith current version of packages something is not working. The functionrestoreLibs() reverts all libraries that were attached previously to their previous versions.
Usage
restoreLibs(md5hash, session_info = NULL, lib.loc = NULL)Arguments
md5hash | One of the following (seearead): A character vector which elements are consisting of at least three components separated with '/': Remote user name, Remote repository and name of the artifact (MD5 hash) or it's abbreviation. MD5 hashes of artifacts in current local default directory or its abbreviations. |
session_info | Object with versions of packages to be installed. If not supplied then it will be extracted from md5hash |
lib.loc | A character vector describing the location of |
Contact
Bug reports and feature requests can be sent tohttps://github.com/pbiecek/archivist/issues
Author(s)
Marcin Kosinski,m.p.kosinski@gmail.com \Przemyslaw Biecek,przemyslaw.biecek@gmail.com
References
Biecek P and Kosinski M (2017). "archivist: An R Package for Managing,Recording and Restoring Data Analysis Results." _Journal of StatisticalSoftware_, *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(),archivistPackage,aread(),areadLocal(),asearch(),asearchLocal(),asession(),atrace(),cache(),copyLocalRepo(),createLocalRepo(),createMDGallery(),deleteLocalRepo(),getRemoteHook(),getTagsLocal(),loadFromLocalRepo(),md5hash,removeTagsRepo(),rmFromLocalRepo(),saveToLocalRepo(),searchInLocalRepo(),setLocalRepo(),shinySearchInLocalRepo(),showLocalRepo(),splitTagsLocal(),summaryLocalRepo(),zipLocalRepo()
Examples
## Not run: ## objects preparation## be aware! this will probably downgrade many of your librariesrestoreLibs(md5hash = "pbiecek/graphGallery/7f3453331910e3f321ef97d87adb5bad")## End(Not run)Remove an Artifact Given as a md5hash from the Repository
Description
rmFromLocalRepo removes an artifact given as amd5hash from theRepository.To learn more about artifacts visitarchivistPackage.
Usage
rmFromLocalRepo( md5hash, repoDir = aoptions("repoDir"), removeData = FALSE, removeMiniature = FALSE, force = FALSE, many = FALSE)rmFromRepo(...)Arguments
md5hash | A character assigned to the artifact through the use of acryptographical hash function with MD5 algorithm, or it's abbreviation.This object will be removed. If |
repoDir | A character denoting an existing directory from which an artifact will be removed. |
removeData | A logical value denoting whether to remove data along withthe |
removeMiniature | A logical value denoting whether to remove a miniaturealong with the |
force | A logical value denoting whether to remove data related to more than one artifact.Defualt |
many | A logical value. To accelerate the speed of removing many objects,you can set this parameter to |
... | All arguments are being passed to |
Details
rmFromLocalRepo removes an artifact given as amd5hash from theRepository.To be more precise, an artifact is removed both frombackpack.db file(the SQLite database)andgallery subdirectory,where the artifacts are stored asmd5hash.rda files.
Important: instead of giving the wholemd5hash character, a usercan simply give its first few characters. For example,"a09dd" instead of"a09ddjdkf9kj33dcjdnfjgos9jd9jkcv".All artifacts with the samemd5hash abbreviation will be removed from theRepository.
rmFromLocalRepo provides functionality that enables us to delete miniaturesof the artifacts (.txt or .png files) while removing .rda files.To delete miniature of the artifact useremoveMiniature = TRUE argument.Moreover, if the data from the artifact is archived then there is a possibility to delete this data while removing the artifact. Simply useremoveData = TRUE argument.
If one wants to remove all artifacts created between two dates, it is suggested toperform:
obj2rm <- searchInLocalRepo( tag = list(dateFrom, dateTo), repoDir = )sapply(obj2rm, rmFromLocalRepo, repoDir = )
Contact
Bug reports and feature requests can be sent tohttps://github.com/pbiecek/archivist/issues
Note
md5hash can be a result of thesearchInLocalRepo function calledbytag = NAME argument, whereNAME is a Tag that describesthe property of the artifacts to be deleted.
It is not possible to use a vector of artifacts'md5hashes abbreviationswhile usingmany = TRUE argument. This assumption was made to protect a user from removing, by accident, too many artifacts from the Repository.
For more information aboutTags checkTags.
Author(s)
Marcin Kosinski ,m.p.kosinski@gmail.comWitold Chodor ,witoldchodor@gmail.com
References
Biecek P and Kosinski M (2017). "archivist: An R Package for Managing,Recording and Restoring Data Analysis Results." _Journal of StatisticalSoftware_, *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(),archivistPackage,aread(),areadLocal(),asearch(),asearchLocal(),asession(),atrace(),cache(),copyLocalRepo(),createLocalRepo(),createMDGallery(),deleteLocalRepo(),getRemoteHook(),getTagsLocal(),loadFromLocalRepo(),md5hash,removeTagsRepo(),restoreLibs(),saveToLocalRepo(),searchInLocalRepo(),setLocalRepo(),shinySearchInLocalRepo(),showLocalRepo(),splitTagsLocal(),summaryLocalRepo(),zipLocalRepo()
Other archivist:Repository,Tags,%a%(),addHooksToPrint(),addTagsRepo(),aformat(),ahistory(),alink(),aoptions(),archivistPackage,aread(),areadLocal(),asearch(),asearchLocal(),asession(),atrace(),cache(),copyLocalRepo(),createLocalRepo(),createMDGallery(),deleteLocalRepo(),getRemoteHook(),getTagsLocal(),loadFromLocalRepo(),md5hash,removeTagsRepo(),restoreLibs(),saveToLocalRepo(),searchInLocalRepo(),setLocalRepo(),shinySearchInLocalRepo(),showLocalRepo(),splitTagsLocal(),summaryLocalRepo(),zipLocalRepo()
Examples
## Not run: # objects preparationdata.frame objectdata(iris)# ggplot/gg objectlibrary(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 objectmodel <- lm(Sepal.Length~ Sepal.Width + Petal.Length + Petal.Width, data= iris)model2 <- lm(Sepal.Length~ Sepal.Width + Petal.Width, data= iris)model3 <- lm(Sepal.Length~ Sepal.Width, data= iris)# agnes (twins) objectlibrary(cluster)data(votes.repub)agn1 <- agnes(votes.repub, metric = "manhattan", stand = TRUE)# fanny (partition) objectx <- 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 - on which examples will workexampleRepoDir <- tempfile()createLocalRepo(repoDir = exampleRepoDir)myplot123Md5hash <- saveToLocalRepo(myplot123, repoDir=exampleRepoDir)irisMd5hash <- saveToLocalRepo(iris, repoDir=exampleRepoDir)modelMd5hash <- saveToLocalRepo(model, repoDir=exampleRepoDir)agn1Md5hash <- saveToLocalRepo(agn1, repoDir=exampleRepoDir)fannyxMd5hash <- saveToLocalRepo(fannyx, repoDir=exampleRepoDir)# let's see how the Repository looks like: showshowLocalRepo(method = "md5hashes", repoDir = exampleRepoDir)showLocalRepo(method = "tags", repoDir = exampleRepoDir)# let's see how the Repository looks like: summarysummaryLocalRepo( exampleRepoDir )# remove examplesrmFromLocalRepo(fannyxMd5hash, repoDir = exampleRepoDir)# removeData = FALSE default argument provides from removing archived# fannyxMd5hash object's data from the Repository and the galleryrmFromLocalRepo(irisMd5hash, repoDir = exampleRepoDir) # let's see how the Repository looks like: showshowLocalRepo(method = "md5hashes", repoDir = exampleRepoDir)showLocalRepo(method = "tags", repoDir = exampleRepoDir)# let's see how the Repository looks like: summarysummaryLocalRepo( exampleRepoDir )# one can have the same object archived three different times,# there will appear a warning messageagn1Md5hash2 <- saveToLocalRepo(agn1, repoDir=exampleRepoDir)agn1Md5hash3 <- saveToLocalRepo(agn1, repoDir=exampleRepoDir)# md5hashes are the same for the same object (agn1)agn1Md5hash == agn1Md5hash2agn1Md5hash2 == agn1Md5hash3# but in the Repository database (backpack.db)# there are three identical rows describing the object# as well as three identical rows describing object's data.# let's see how the Repository looks like: showshowLocalRepo(method = "md5hashes", repoDir = exampleRepoDir)showLocalRepo(method = "tags", repoDir = exampleRepoDir)# let's see how the Repository looks like: summarysummaryLocalRepo( exampleRepoDir )# in spite of multiplying object's appearance in database it is# one easy call removes them all but this call will result in errorrmFromLocalRepo(agn1Md5hash, repoDir = exampleRepoDir, removeData = TRUE, removeMiniature = TRUE)# soultion to that isrmFromLocalRepo(agn1Md5hash, repoDir = exampleRepoDir, removeData = TRUE, removeMiniature = TRUE, force = TRUE)# removeMiniature = TRUE removes miniatures from the gallery folder# rest of the artifacts can be removed for example by# looking for dates of creation and then removing all objects# created in a specific period of timeobj2rm <- searchInLocalRepo( pattern = list(dateFrom = Sys.Date(), dateTo = Sys.Date()), repoDir = exampleRepoDir )sapply(obj2rm, rmFromLocalRepo, repoDir = exampleRepoDir)# above function call removed all objects which were created in these examples.# Note that in the gallery folder there may be still some miniatures as# removeMiniature parameter is set to FALSE# let's see how the Repository looks like: showshowLocalRepo(method = "md5hashes", repoDir = exampleRepoDir)showLocalRepo(method = "tags", repoDir = exampleRepoDir)# one can also delete objects of a specific classmodelMd5hash <- saveToLocalRepo(model, repoDir=exampleRepoDir)model2Md5hash <- saveToLocalRepo(model2, repoDir=exampleRepoDir)model3Md5hash <- saveToLocalRepo(model3, repoDir=exampleRepoDir)showLocalRepo(method = "md5hashes", repoDir = exampleRepoDir)objMd5hash <- searchInLocalRepo("class:lm", repoDir = exampleRepoDir)sapply(objMd5hash, rmFromLocalRepo, repoDir = exampleRepoDir, removeData = TRUE, force = TRUE)showLocalRepo(method = "md5hashes", repoDir = exampleRepoDir)summaryLocalRepo( exampleRepoDir )# one can remove object specifying only its md5hash abbreviation(myplo123Md5hash <- saveToLocalRepo(myplot123, repoDir=exampleRepoDir))showLocalRepo(method = "md5hashes", repoDir = exampleRepoDir)# If md5hash is "db50a4e667581f8c531acd78ad24bfee" then# model abbreviation might be : "db50a"# Note that with each evaluation of createEmptyRepo function new md5hashes# are created. This is why, in your evaluation of the code, artifact # myplo123Md5hash will have a different md5hash and the following# instruction will result in an error.rmFromLocalRepo("db40a", repoDir = exampleRepoDir, removeData = TRUE)summaryLocalRepo( repoDir = exampleRepoDir )# removing an example RepositorydeleteLocalRepo( exampleRepoDir, TRUE)############REMOVING MANY ARTIFACTS############data(iris)# lm objectmodel <- lm(Sepal.Length~ Sepal.Width + Petal.Length + Petal.Width, data= iris)# agnes (twins) objectlibrary(cluster)data(votes.repub)agn1 <- agnes(votes.repub, metric = "manhattan", stand = TRUE)# fanny (partition) objectx <- 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)# lda objectlibrary(MASS)Iris <- data.frame(rbind(iris3[,,1], iris3[,,2], iris3[,,3]), Sp = rep(c("s","c","v"), rep(50,3)))train <- c(8,83,115,118,146,82,76,9,70,139,85,59,78,143,68, 134,148,12,141,101,144,114,41,95,61,128,2,42,37, 29,77,20,44,98,74,32,27,11,49,52,111,55,48,33,38, 113,126,24,104,3,66,81,31,39,26,123,18,108,73,50, 56,54,65,135,84,112,131,60,102,14,120,117,53,138,5)lda1 <- lda(Sp ~ ., Iris, prior = c(1,1,1)/3, subset = train)# qda objecttr <- c(7,38,47,43,20,37,44,22,46,49,50,19,4,32,12,29,27,34,2,1,17,13,3,35,36)train <- rbind(iris3[tr,,1], iris3[tr,,2], iris3[tr,,3])cl <- factor(c(rep("s",25), rep("c",25), rep("v",25)))qda1 <- qda(train, cl)# glmnet objectlibrary( glmnet )zk=matrix(rnorm(100*20),100,20)bk=rnorm(100)glmnet1=glmnet(zk,bk) # Creating example Repository so that we may see it on our computerexampleRepoDir <- tempfile()createLocalRepo( repoDir = exampleRepoDir, force = TRUE)saveToLocalRepo( iris, repoDir=exampleRepoDir)saveToLocalRepo( model, repoDir=exampleRepoDir )saveToLocalRepo( agn1, repoDir=exampleRepoDir )saveToLocalRepo( fannyx, repoDir=exampleRepoDir )saveToLocalRepo( lda1, repoDir=exampleRepoDir )saveToLocalRepo( glmnet1, repoDir=exampleRepoDir )ArtifactsAndData <- unique(showLocalRepo(repoDir = exampleRepoDir)[,1])ArtifactsData <- unique(searchInLocalRepo(pattern = "relationWith", fixed = FALSE, repoDir = exampleRepoDir))Artifacts <- setdiff(ArtifactsAndData, ArtifactsData)# Removing many artifacts with many = TRUE argumentrmFromLocalRepo(Artifacts, repoDir = exampleRepoDir, many = TRUE)# We may notice, in two ways, that artifacts' data is still in "exampleRepoDir".# Either we may look into gallery folder of "exampleRepoDir" list.files(file.path(exampleRepoDir, "gallery"))# or show how database.db file looks like.showLocalRepo(repoDir = exampleRepoDir) # artifacts' data is there indeed!# If we want to remove artifact's data now we simply call rmFromLocalRepo function# with removeData = TRUE additional argument.rmFromLocalRepo(Artifacts, repoDir = exampleRepoDir, removeData = TRUE, many = TRUE)# We receive a warning as Artifacts are no longer in the repository. # However, let's check what happened with Artifact's data.showLocalRepo(repoDir = exampleRepoDir) # They were removed.# Perhaps you may think that "exampleRepoDir" is empty as database indicates. However,# if you look into gallery folder there will be some ".txt" or ".png" files. list.files(file.path(exampleRepoDir, "gallery"))# Those are probably, the so called, Miniatures. Let's try to remove them.# In order to do it we call rmFromLocalRepo function with removeMiniature = TRUE argument.rmFromLocalRepo(Artifacts, many = TRUE, repoDir = exampleRepoDir, removeMiniature = TRUE)# Again we receive a warning as Artifacts are no longer in the repository but ...list.files(file.path(exampleRepoDir, "gallery")) # gallery folder is empty now! Artifact's miniature's were removed.# Of course we may have done all these instructions by one simple function call.# rmFromLocalRepo(Artifacts, many = TRUE, repoDir = exampleRepoDir,# removeData = TRUE, removeMiniature = TRUE)# Nevertheless, it may be instructive to see how it is done step by step.# removing an example RepositorydeleteLocalRepo(repoDir = exampleRepoDir, deleteRoot = TRUE) rm( exampleRepoDir )## End(Not run)Save an Artifact into a Repository
Description
saveToLocalRepo function saves desired artifacts to the localRepository in a given directory.To learn more about artifacts visitarchivistPackage.
Usage
saveToLocalRepo( artifact, repoDir = aoptions("repoDir"), archiveData = TRUE, archiveTags = TRUE, archiveMiniature = TRUE, archiveSessionInfo = TRUE, force = TRUE, value = FALSE, ..., userTags = c(), use_flocks = aoptions("use_flocks"), silent = aoptions("silent"), ascii = FALSE, artifactName = deparse(substitute(artifact)))saveToRepo( artifact, repoDir = aoptions("repoDir"), archiveData = TRUE, archiveTags = TRUE, archiveMiniature = TRUE, archiveSessionInfo = TRUE, force = TRUE, value = FALSE, ..., userTags = c(), use_flocks = aoptions("use_flocks"), silent = aoptions("silent"), ascii = FALSE, artifactName = deparse(substitute(artifact)))asave( artifact, repoDir = aoptions("repoDir"), archiveData = TRUE, archiveTags = TRUE, archiveMiniature = TRUE, archiveSessionInfo = TRUE, force = TRUE, value = FALSE, ..., userTags = c(), use_flocks = aoptions("use_flocks"), silent = aoptions("silent"), ascii = FALSE, artifactName = deparse(substitute(artifact)))Arguments
artifact | An arbitrary R artifact to be saved. For supported artifacts see details. |
repoDir | A character denoting an existing directory in which an artifact will be saved. |
archiveData | A logical value denoting whether to archive the data from the |
archiveTags | A logical value denoting whether to archive Tags from the |
archiveMiniature | A logical value denoting whether to archive a miniature of the |
archiveSessionInfo | A logical value denoting whether to archive the session info that describes the context in this given artifact was created. |
force | A logical value denoting whether to archive |
value | A logical value. Should the result be (default |
... | Graphical parameters denoting width and height of a miniature. See details.Further arguments passed tohead. See Details section about |
userTags | A character vector with Tags. These Tags will be added to the repository along with the artifact. |
use_flocks | A logical value. If |
silent | If TRUE produces no warnings. |
ascii | A logical value. An |
artifactName | The name of the artifact with which it should be archived. If |
Details
saveToLocalRepo function saves desired artifacts to the local Repository in a given directory.Artifacts are saved in the local Repository, which is a SQLite database namedbackpack.After everysaveToLocalRepo call the database is refreshed, so the artifact is availableimmediately in the database for other collaborators.Each artifact is archived in amd5hash.rda file. This file will be saved in a folder(underrepoDir directory) namedgallery. For each artifact,md5hash is aunique string of length 32 that is produced bydigest function, which uses a cryptographical MD5 hash algorithm.
By default, a miniature of an artifact and (if possible) a data set needed to compute this artifact are extracted.They are also going to be saved in a file named by theirmd5hash in thegallery folderthat exists in the directory specified in therepoDir argument. Moreover, a specificTag-relationis going to be added to thebackpack dataset in case there is a need to loadthe artifact with it's related data set - seeloadFromLocalRepo orloadFromRemoteRepo. Default settingsmay be changed by using thearchiveData,archiveTag orarchiveMiniature arguments with theFALSE value.
Tags are artifact's attributes, different for various artifact's classes. For more detailedinformation checkTags
Archived artifact can be searched in thebackpack dataset by using thesearchInLocalRepo orsearchInRemoteRepo functions. Artifacts can be searched by theirTags,names,classes orarchiving date.
firstRows parameter.
If the artifact is of classdata.frame or user setarchiveData = TRUE for artifact that stores data within it,it is possible to specifyhow many rows of that data (or thatdata.frame) should be archived in aminiature.This can be done by adding the argumentfirstRows with then corresponding to the number of rows (as inhead).Note that, the data can be extracted only from the artifacts that are supported bythearchivist package; seeTags.
Graphical parameters.
If the artifact is of classlattice,ggplot orrecordedplot, andarchiveMiniature = TRUE, then it ispossible to set the miniature'swidth andheight parameters. By default they are set towidth = 800,height = 600.
Supported artifact's classes are listed hereTags.
Value
As a result of calling this function a character string is returned, which determinesthemd5hash of the artifact. IfarchiveData isTRUE, the result will alsohave an attribute, nameddata, which determinesmd5hash of the data neededto compute the artifact.
Contact
Bug reports and feature requests can be sent tohttps://github.com/pbiecek/archivist/issues
Note
In the following way one can specify his ownTags for artifacts by setting artifact's attributebefore call of thesaveToLocalRepo function:attr(x, "tags" ) = c( "name1", "name2" ), wherex is an artifactandname1, name2 areTags specified by a user.It can be also done in a new, simpler way by usinguserTags parameter like this:
saveToLocalRepo(model, repoDir, userTags = c("my_model", "do not delete")).
Specifying additionalTags by attributes can be beneficial when one usesaddHooksToPrint.
Important: if one wants to archive data from artifacts which is one of:survfit, glmnet, qda, lda, trellis, htest class, and this dataset is transformed withinthe artifact's formula thensaveToLocalRepo will not archive this dataset.saveToLocalRepoonly archives datasets that already exist in any of R environments.
Example: The data set will not be archived here.
z <- lda(Sp ~ ., Iris, prior = c(1,1,1)/3, subset = train[,-8])saveToLocalRepo( z, repoDir )
Example: The data set will be archived here.
train2 <- train[,-8]z <- lda(Sp ~ ., Iris, prior = c(1,1,1)/3, subset = train2)saveToLocalRepo( z, repoDir )
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 StatisticalSoftware_, *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
For more detailed information check thearchivist packageUse Cases.The list of supported artifacts and their tags is available onwiki onarchivistGithub Repository.
Other archivist:Repository,Tags,%a%(),addHooksToPrint(),addTagsRepo(),aformat(),ahistory(),alink(),aoptions(),archivistPackage,aread(),areadLocal(),asearch(),asearchLocal(),asession(),atrace(),cache(),copyLocalRepo(),createLocalRepo(),createMDGallery(),deleteLocalRepo(),getRemoteHook(),getTagsLocal(),loadFromLocalRepo(),md5hash,removeTagsRepo(),restoreLibs(),rmFromLocalRepo(),searchInLocalRepo(),setLocalRepo(),shinySearchInLocalRepo(),showLocalRepo(),splitTagsLocal(),summaryLocalRepo(),zipLocalRepo()
Examples
## Not run: exampleRepoDir <- tempfile(tmpdir = ".")createLocalRepo(repoDir = exampleRepoDir)data(swiss)saveToLocalRepo(swiss, repoDir=exampleRepoDir, archiveSessionInfo = TRUE)showLocalRepo(method = "md5hashes", repoDir = exampleRepoDir)showLocalRepo(method = "tags", repoDir = exampleRepoDir)loadFromLocalRepo(md5hash = '2a6e492cb6982f230e48cf46023e2e4f', repoDir = system.file("graphGallery", package = "archivist"), value = TRUE) -> modelsaveToLocalRepo(model, repoDir=exampleRepoDir, userTags = c("do not delete", "my favourite model"))aoptions('repoDir', system.file("graphGallery", package = "archivist"))showLocalRepo(method = "tags")data(iris)asave(iris, silent = FALSE) # iris was used in plaoptions('repoDir', NULL, unset = TRUE)deleteLocalRepo(exampleRepoDir, TRUE)rm(exampleRepoDir)## End(Not run)Search for an Artifact in the Repository Using Tags
Description
searchInRepo searches for an artifact in theRepository using it'sTags.To learn more about artifacts visitarchivistPackage.
Usage
searchInLocalRepo( pattern, repoDir = aoptions("repoDir"), fixed = TRUE, intersect = TRUE)searchInRemoteRepo( pattern, repo = aoptions("repo"), user = aoptions("user"), branch = "master", subdir = aoptions("subdir"), repoType = aoptions("repoType"), fixed = TRUE, intersect = TRUE)multiSearchInLocalRepo(...)multiSearchInRemoteRepo(...)Arguments
pattern | If |
repoDir | A character denoting an existing directory in which artifacts will be searched for. |
fixed | A logical value specifying how |
intersect | A logical value. Used only when |
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 |
user | While working with the Remote repository. A character containing a name of the Remote user on whose account the |
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 |
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 the main folder of the Remote repository, this should be set to |
repoType | A character containing a type of the remote repository. Currently it can be 'github' or 'bitbucket'. |
... | Used for old deprecated functions. |
Details
searchInRepo searches for an artifact in the Repository using it'sTag (e.g.,name,class orarchiving date).Tags are used in apatternparameter. For various artifact classes differentTags can be searched for. SeeTags. If apattern is a list of length 2 thenmd5hashes of all artifacts created from datedateFrom to datedateTo are returned. The date should be formatted according to the YYYY-MM-DD format, e.g.,"2014-07-31".
Tags, used in apattern parameter, should be determined according to the format:"TagKey:TagValue" - see examples.
Value
searchInRepo returns character vector ofmd5hashes of artifacts that were searched for.Those are hashes assigned to artifacts while they were saved in the Repositoryby thesaveToLocalRepo function. If the artifactis not in the Repository then a logical valueFALSE is returned.
Contact
Bug reports and feature requests can be sent tohttps://github.com/pbiecek/archivist/issues
Note
Ifrepo,user,subdir andrepoType are not specified in the Remote mode then global parametersset insetRemoteRepo function are used.
Bug reports and feature requests can be sent tohttps://github.com/pbiecek/archivist/issues
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 StatisticalSoftware_, *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(),archivistPackage,aread(),areadLocal(),asearch(),asearchLocal(),asession(),atrace(),cache(),copyLocalRepo(),createLocalRepo(),createMDGallery(),deleteLocalRepo(),getRemoteHook(),getTagsLocal(),loadFromLocalRepo(),md5hash,removeTagsRepo(),restoreLibs(),rmFromLocalRepo(),saveToLocalRepo(),setLocalRepo(),shinySearchInLocalRepo(),showLocalRepo(),splitTagsLocal(),summaryLocalRepo(),zipLocalRepo()
Other archivist:Repository,Tags,%a%(),addHooksToPrint(),addTagsRepo(),aformat(),ahistory(),alink(),aoptions(),archivistPackage,aread(),areadLocal(),asearch(),asearchLocal(),asession(),atrace(),cache(),copyLocalRepo(),createLocalRepo(),createMDGallery(),deleteLocalRepo(),getRemoteHook(),getTagsLocal(),loadFromLocalRepo(),md5hash,removeTagsRepo(),restoreLibs(),rmFromLocalRepo(),saveToLocalRepo(),setLocalRepo(),shinySearchInLocalRepo(),showLocalRepo(),splitTagsLocal(),summaryLocalRepo(),zipLocalRepo()
Other archivist:Repository,Tags,%a%(),addHooksToPrint(),addTagsRepo(),aformat(),ahistory(),alink(),aoptions(),archivistPackage,aread(),areadLocal(),asearch(),asearchLocal(),asession(),atrace(),cache(),copyLocalRepo(),createLocalRepo(),createMDGallery(),deleteLocalRepo(),getRemoteHook(),getTagsLocal(),loadFromLocalRepo(),md5hash,removeTagsRepo(),restoreLibs(),rmFromLocalRepo(),saveToLocalRepo(),setLocalRepo(),shinySearchInLocalRepo(),showLocalRepo(),splitTagsLocal(),summaryLocalRepo(),zipLocalRepo()
Examples
## Not run: # objects preparation showLocalRepo(method = "md5hashes", repoDir = system.file("graphGallery", package = "archivist")) showLocalRepo(method = "tags", repoDir = system.file("graphGallery", package = "archivist")) # Tag search, fixed version searchInLocalRepo( "class:ggplot", repoDir = exampleRepoDir ) searchInLocalRepo( "name:", repoDir = exampleRepoDir ) # Tag search, regex version searchInLocalRepo( "class", repoDir = exampleRepoDir, fixed = FALSE ) # Github version # check the state of the Repository summaryRemoteRepo( user="pbiecek", repo="archivist" ) showRemoteRepo( user="pbiecek", repo="archivist" ) showRemoteRepo( user="pbiecek", repo="archivist", method = "tags" ) # Tag search, fixed version searchInRemoteRepo( "varname:Sepal.Width", user="pbiecek", repo="archivist" ) searchInRemoteRepo( "class:lm", user="pbiecek", repo="archivist", branch="master" ) searchInRemoteRepo( "name:myplot123", user="pbiecek", repo="archivist" ) # Tag search, regex version searchInRemoteRepo( "class", user="pbiecek", repo="archivist", fixed = FALSE ) searchInRemoteRepo( "name", user="pbiecek", repo="archivist", fixed = FALSE ) # also on Github # Remeber to set dateTo parameter to actual date because sometimes we update datasets. searchInRemoteRepo( pattern = list( dateFrom = "2015-10-01", dateTo = "2015-11-30" ), user="pbiecek", repo="archivist", branch="master" ) # many archivist-like Repositories on one Remote repository searchInRemoteRepo( pattern = "name", user="MarcinKosinski", repo="Museum", branch="master", subdir="ex1", fixed = FALSE ) searchInRemoteRepo( pattern = "name", user="MarcinKosinski", repo="Museum", branch="master", subdir="ex2", fixed = FALSE ) # multi versions searchInRemoteRepo( pattern=c("varname:Sepal.Width", "class:lm", "name:myplot123"), user="pbiecek", repo="archivist", intersect = FALSE ) ## End(Not run)Set Repository's Global Path
Description
setLocalRepo sets localRepository's global path.setRemoteRepo similarly sets Remote Repository's path.See examples.
Usage
setLocalRepo(repoDir)setPostgresRepo(repoDir, connector = NULL)setRemoteRepo(user, repo, branch = "master", subdir = "/", repoType = "github")Arguments
repoDir | A character denoting a directory of a Repository that we want tomake default. |
connector | If user want to use some external database instead of SQLite, then the |
user | While working with the Remote repository. A character containinga name of the Remote user that we want to make default. |
repo | While working with the Remote repository. A character containinga name of the Remote repository that we want to make default. |
branch | While working with the Remote repository. A character containing a name of the Remote Repository's branch that we want to make default. Default |
subdir | While working with the Remote repository. A character containing a nameof the Repository's directory on Remote that we want to make default.If the Repository is stored in the main folder on the Remote repository,this should be set to |
repoType | A character containing a type of the remote repository. Currently it can be 'github' or 'bitbucket'. |
Details
If you are working on a local Repository and you are tired of specifyingrepoDirparameter in every function call that uses this parameter, you can set Repository's pathglobally usingsetLocalRepo function and omitrepoDir parameterin future function calls.
If you are working on the Remote Repository and you are tired of specifyinguser,repo,branch andsubdir parameters in every function callthat uses these parameters, you can set Remote Repository's path globally usingsetRemoteRepo function and omituser,repo,branchandsubdir parameters in future function calls. See examples.
For local repositories, in this way, in the following function calls:loadFromLocalRepo,searchInLocalRepo,rmFromLocalRepo,zipLocalRepo,addTagsRepo,shinySearchInLocalRepo,getTagsLocal,showLocalRepo,summaryLocalReporepoDir parameter may be omitted. For remote repositories, in this way,in the following function calls:zipRemoteRepo,loadFromRemoteRepo,searchInRemoteRepo,getTagsRemote,showRemoteRepo,summaryRemoteRepo,copyRemoteRepoparametersuser,repo,branch,subdir may be omitted.
Contact
Bug reports and feature requests can be sent tohttps://github.com/pbiecek/archivist/issues
Author(s)
Marcin Kosinski,m.p.kosinski@gmail.com
Przemyslaw Biecek,przemyslaw.biecek@gmail.com
References
Biecek P and Kosinski M (2017). "archivist: An R Package for Managing,Recording and Restoring Data Analysis Results." _Journal of StatisticalSoftware_, *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
https://github.com/pbiecek/archivist/wiki
Other archivist:Repository,Tags,%a%(),addHooksToPrint(),addTagsRepo(),aformat(),ahistory(),alink(),aoptions(),archivistPackage,aread(),areadLocal(),asearch(),asearchLocal(),asession(),atrace(),cache(),copyLocalRepo(),createLocalRepo(),createMDGallery(),deleteLocalRepo(),getRemoteHook(),getTagsLocal(),loadFromLocalRepo(),md5hash,removeTagsRepo(),restoreLibs(),rmFromLocalRepo(),saveToLocalRepo(),searchInLocalRepo(),shinySearchInLocalRepo(),showLocalRepo(),splitTagsLocal(),summaryLocalRepo(),zipLocalRepo()
Other archivist:Repository,Tags,%a%(),addHooksToPrint(),addTagsRepo(),aformat(),ahistory(),alink(),aoptions(),archivistPackage,aread(),areadLocal(),asearch(),asearchLocal(),asession(),atrace(),cache(),copyLocalRepo(),createLocalRepo(),createMDGallery(),deleteLocalRepo(),getRemoteHook(),getTagsLocal(),loadFromLocalRepo(),md5hash,removeTagsRepo(),restoreLibs(),rmFromLocalRepo(),saveToLocalRepo(),searchInLocalRepo(),shinySearchInLocalRepo(),showLocalRepo(),splitTagsLocal(),summaryLocalRepo(),zipLocalRepo()
Other archivist:Repository,Tags,%a%(),addHooksToPrint(),addTagsRepo(),aformat(),ahistory(),alink(),aoptions(),archivistPackage,aread(),areadLocal(),asearch(),asearchLocal(),asession(),atrace(),cache(),copyLocalRepo(),createLocalRepo(),createMDGallery(),deleteLocalRepo(),getRemoteHook(),getTagsLocal(),loadFromLocalRepo(),md5hash,removeTagsRepo(),restoreLibs(),rmFromLocalRepo(),saveToLocalRepo(),searchInLocalRepo(),shinySearchInLocalRepo(),showLocalRepo(),splitTagsLocal(),summaryLocalRepo(),zipLocalRepo()
Examples
## Not run: ## Local versionexampleRepoDir <- tempfile()createLocalRepo(repoDir = exampleRepoDir)setLocalRepo(exampleRepoDir) data(iris)data(swiss)# From this moment repoDir parameter may be ommitted in the following functionssaveToRepo(iris)saveToRepo(swiss) showLocalRepo()showLocalRepo(method = "tags")iris2 <- loadFromLocalRepo( "ff575c2" , value = TRUE)searchInLocalRepo("name:i", fixed = FALSE)getTagsLocal("ff575c261c949d073b2895b05d1097c3")rmFromLocalRepo("4c43f")showLocalRepo()summaryLocalRepo()# REMEMBER that in deleteLocalRepo you MUST specify repoDir parameter!# deleteRepo doesn't take setLocalRepo's settings into considerationdeleteLocalRepo( exampleRepoDir, deleteRoot=TRUE)rm( exampleRepoDir )## Github versionsetRemoteRepo( user="MarcinKosinski", repo="Museum", branch="master", subdir="ex1" ) # From this moment user, repo, branch, subdir parameters may be ommitted# in the following functions:showRemoteRepo()loadFromRemoteRepo( "ff575c261c949d073b2895b05d1097c3")this <- loadFromRemoteRepo( "ff", value = TRUE)zipRemoteRepo()file.remove(file.path(getwd(), "repository.zip")) # We can remove this zip filesearchInRemoteRepo( "name:", fixed= FALSE)getTagsRemote("ff575c261c949d073b2895b05d1097c3")summaryRemoteRepo( )# To use multisearchInRemoteRepo we should use repository with more than one artifact. setRemoteRepo( user="pbiecek", repo="archivist" )# From this moment user and repo parameters may be ommitted in the following functionsshowRemoteRepo()searchInRemoteRepo( pattern=c("varname:Sepal.Width", "class:lm", "name:myplot123"), intersect = FALSE )## End(Not run)Shiny Based Live Search for an Artifact in a Repository Using Tags
Description
shinySearchInLocalRepo searches for an artifact in aRepository usingTags.To create an application one needs to point the name of artifacts' repository.The application is generated on the run. As for now there are two controllers exposed. A text input field and a slider. Tags that are typed into text field are used for searching in repository. Objects that have the same Tags are presented on the right panel.These object might be also downloaded just by click.To learn more about artifacts visitarchivistPackage.
Usage
shinySearchInLocalRepo(repoDir = NULL, host = "0.0.0.0")Arguments
repoDir | A character denoting an existing directory in which artifacts will be searched.If set to |
host | A host IP adress, see the |
Details
shinySearchInLocalRepo searches for artifacts in a Repository using theirTags (e.g.,name,class orarchiving date).Tags are submitted in a text input in a shiny application. Many Tags may be specified, they should be comma separated. User can specify more Tags like phase, project, author etc. when artifact is created.
In the search query one can add Tags starting withsort: orsort:-.As a result, miniatures will be sorted appropriately.For examplesort:class will sortclass Tags, whilesort:-class willsortclass tags backwards.sort:createdDate will sortcreatedDate Tag andsort:-createdDate will sortcreatedDate Tag backwards.
Tags, submitted in the text field, should be given according to the format:"TagKey:TagValue" - see examples.
Value
shinySearchInLocalRepo runs a shiny application.
Contact
Bug reports and feature requests can be sent tohttps://github.com/pbiecek/archivist/issues
shiny
This function use tools from the fantasticshinypackage, so you'll need to make sure to have it installed.
Author(s)
Przemyslaw Biecek,przemyslaw.biecek@gmail.com
References
Biecek P and Kosinski M (2017). "archivist: An R Package for Managing,Recording and Restoring Data Analysis Results." _Journal of StatisticalSoftware_, *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(),archivistPackage,aread(),areadLocal(),asearch(),asearchLocal(),asession(),atrace(),cache(),copyLocalRepo(),createLocalRepo(),createMDGallery(),deleteLocalRepo(),getRemoteHook(),getTagsLocal(),loadFromLocalRepo(),md5hash,removeTagsRepo(),restoreLibs(),rmFromLocalRepo(),saveToLocalRepo(),searchInLocalRepo(),setLocalRepo(),showLocalRepo(),splitTagsLocal(),summaryLocalRepo(),zipLocalRepo()
Examples
## Not run: # assuming that there is a 'repo' dir with a valid archivist repository shinySearchInLocalRepo( repoDir = 'repo' )## End(Not run)View the List of Artifacts from the Repository
Description
showLocalRepo andshowRemoteRepo functions produce thedata.frame of the artifacts fromtheRepository saved in a givenrepoDir (directory).showLocalReposhows the artifacts from theRepository that exists on the user's computer whereasshowRemoteReposhows the artifacts of theRepository existing on the remote repository.To learn more about artifacts visitarchivistPackage.
Usage
showLocalRepo(repoDir = aoptions("repoDir"), method = "md5hashes")showRemoteRepo( repo = aoptions("repo"), user = aoptions("user"), branch = aoptions("branch"), subdir = aoptions("subdir"), repoType = aoptions("repoType"), method = "md5hashes")Arguments
repoDir | A character denoting an existing directory of the Repository for which metadata will be returned. |
method | A character specifying a method to be used to show the Repository. Available methods: |
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 |
user | While working with the Remote repository. A character containing a name of the Remote user on whose account the |
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 |
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 the main folder of the Remote repository, this should be set to |
repoType | A character containing a type of the remote repository. Currently it can be 'github' or 'bitbucket'. |
Details
showLocalRepo andshowRemoteRepo functions produce thedata.frame of the artifacts fromaRepository saved in a givenrepoDir (directory).showLocalReposhows the artifacts from theRepository that exists on the user's computer whereasshowRemoteReposhows the artifacts of theRepository existing on the remote repository.
Both functions show the current state of aRepository, inter alia, all archived artifacts canbe seen with their uniquemd5hash or adata.frame with archivedTags can be obtained.
Value
If parametermethod is set asmd5hashes then adata.frame with artifacts' names andartifacts'md5hashes will be returned.
If parametermethod is set astags then adata.frame withTags andartifacts'md5hashes will be returned.
Also in both cases adata.frame contains an extra column with the date of creationof theTag ormd5hash.
To learn more aboutTags ormd5hashes check:Tags ormd5hash.
Contact
Bug reports and feature requests can be sent tohttps://github.com/pbiecek/archivist/issues
Note
Ifrepo anduser are set toNULL (as default) in the Remote mode then global parametersset insetRemoteRepo (or viaaoptions) 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 StatisticalSoftware_, *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(),archivistPackage,aread(),areadLocal(),asearch(),asearchLocal(),asession(),atrace(),cache(),copyLocalRepo(),createLocalRepo(),createMDGallery(),deleteLocalRepo(),getRemoteHook(),getTagsLocal(),loadFromLocalRepo(),md5hash,removeTagsRepo(),restoreLibs(),rmFromLocalRepo(),saveToLocalRepo(),searchInLocalRepo(),setLocalRepo(),shinySearchInLocalRepo(),splitTagsLocal(),summaryLocalRepo(),zipLocalRepo()
Examples
## Not run: # objects preparationshowLocalRepo(method = "md5hashes", repoDir = system.file("graphGallery", package = "archivist"))showLocalRepo(method = "tags", repoDir = system.file("graphGallery", package = "archivist"))# Remote versionshowRemoteRepo(method = "md5hashes", user = "pbiecek", repo = "archivist")showRemoteRepo(method = "tags", user = "pbiecek", repo = "archivist", branch = "master")# many archivist-like Repositories on one Remote repositoryshowRemoteRepo( user="MarcinKosinski", repo="Museum", branch="master", subdir="ex1")showRemoteRepo( user="MarcinKosinski", repo="Museum", branch="master", subdir="ex2") ## Remote optionsshowRemoteRepo('archivist', 'pbiecek')aoptions('user', 'pbiecek')aoptions('repo', 'archivist')loadFromRemoteRepo("ff575c261c", value = TRUE) -> iris123showRemoteRepo('Museum', 'MarcinKosinski', subdir = 'ex1')aoptions('repo', 'Museum')aoptions('user', 'MarcinKosinski')aoptions('subdir', 'ex1')aoptions('branch', 'master')showRemoteRepo()showRemoteRepo(subdir = 'ex2')aoptions('subdir')## End(Not run)Split Tags in Repository
Description
splitTagsLocal andsplitTagsRemote functions splittag column fromtag table placed inbackpack.db into two separate columns:tagKey andtagValue.
Usage
splitTagsLocal(repoDir = aoptions("repoDir"))splitTagsRemote( repo = aoptions("repo"), user = aoptions("user"), branch = aoptions("branch"), subdir = aoptions("subdir"), repoType = aoptions("repoType"))Arguments
repoDir | While working with the local repository. A character denoting an existing directory of the Repository. |
repo | While working with the Github repository. A character containinga name of the Github repository on which the Repository is stored.By default set to |
user | While working with the Github repository. A character containinga name of the Github user on whose account the |
branch | While working with the Github repository. A character containinga name of the Github Repository's branch on which the Repository is stored.Default |
subdir | While working with the Github repository. A character containinga name of a directory on the Github repository on which the Repository is stored.If the Repository is stored in the main folder of the Github repository,this should be set to |
repoType | A character containing a type of the remote repository. Currently it can be 'github' or 'bitbucket'. |
Details
tag column fromtag table has normally the following structure:TagKey:TagValue.splitTagsLocal andsplitTagsRemote functionscan be used to splittag column into two separate columns:tagKey andtagValue. As a result functions fromdplyr packagecan be used to easily summarize, search, and extract artifacts' Tags.Seeexamples.
Value
Adata.frame with 4 columns:artifact,tagKey,tagValue andcreatedDate, corresponding to the current state ofRepository.
Contact
Bug reports and feature requests can be sent tohttps://github.com/pbiecek/archivist/issues
Note
Ifrepo anduser are set toNULL (as default) in the Github modethen global parameters set insetRemoteRepo function are used.
Sometimes we can useaddTags* function oruserTags parameterinsaveToRepo to specify aTag which might not matchTagKey:TagValue structure. It is simplyTag. In this casetagKey = userTags andtagValue = Tag. Seeexamples.
To learn more aboutTags andRepository structure checkTags andRepository.
Author(s)
Witold Chodor ,witoldchodor@gmail.com
References
Biecek P and Kosinski M (2017). "archivist: An R Package for Managing,Recording and Restoring Data Analysis Results." _Journal of StatisticalSoftware_, *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(),archivistPackage,aread(),areadLocal(),asearch(),asearchLocal(),asession(),atrace(),cache(),copyLocalRepo(),createLocalRepo(),createMDGallery(),deleteLocalRepo(),getRemoteHook(),getTagsLocal(),loadFromLocalRepo(),md5hash,removeTagsRepo(),restoreLibs(),rmFromLocalRepo(),saveToLocalRepo(),searchInLocalRepo(),setLocalRepo(),shinySearchInLocalRepo(),showLocalRepo(),summaryLocalRepo(),zipLocalRepo()
Examples
## Not run: ## LOCAL VERSION setLocalRepo(system.file("graphGallery", package = "archivist"))head(showLocalRepo(method = "tags"))head(splitTagsLocal() )## Github Version# Let's check how does table tag look like while we are using the# Gitub repository.# We will choose only special columns of data frames that show Tagshead(showRemoteRepo( user = "pbiecek", repo = "archivist", method = "tags" )[,2])head(splitTagsRemote( user = "pbiecek", repo = "archivist" )[,2:3])head(splitTagsRemote("PieczaraPietraszki", "BetaAndBit", "master", "UniwersytetDzieci/arepo"))## End(Not run)View the Summary of the Repository
Description
summaryRepo summarizes the current state of theRepository.
Usage
summaryLocalRepo(repoDir = aoptions("repoDir"))summaryRemoteRepo( repo = aoptions("repo"), user = aoptions("user"), branch = "master", subdir = aoptions("subdir"), repoType = aoptions("repoType"))Arguments
repoDir | A character denoting an existing directory of the Repository for which a summary will be returned. |
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 |
user | While working with the Remote repository. A character containing a name of the Remote user on whose account the |
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 |
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 the main folder of the Remote repository, this should be set to |
repoType | A character containing a type of the remote repository. Currently it can be 'github' or 'bitbucket'. |
Details
summaryRepo summarizes the current state of aRepository. Recommended to useprint( summaryRepo ) ). See examples.
Value
An object of classrepository which can be printed:print(object).
Contact
Bug reports and feature requests can be sent tohttps://github.com/pbiecek/archivist/issues
Note
If the same artifact was archived many times then it is counted as one artifact or database inprint(summaryRepo).
Ifrepo anduser are set toNULL (as default) in the Remote mode then global parametersset insetRemoteRepo 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 StatisticalSoftware_, *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(),archivistPackage,aread(),areadLocal(),asearch(),asearchLocal(),asession(),atrace(),cache(),copyLocalRepo(),createLocalRepo(),createMDGallery(),deleteLocalRepo(),getRemoteHook(),getTagsLocal(),loadFromLocalRepo(),md5hash,removeTagsRepo(),restoreLibs(),rmFromLocalRepo(),saveToLocalRepo(),searchInLocalRepo(),setLocalRepo(),shinySearchInLocalRepo(),showLocalRepo(),splitTagsLocal(),zipLocalRepo()
Examples
## Not run: showLocalRepo(repoDir = system.file("graphGallery", package = "archivist"))## Remote version# x <- summaryRemoteRepo( user="pbiecek", repo="archivist")print( x )# many archivist-like Repositories on one Remote repository summaryRemoteRepo(user="MarcinKosinski", repo="Museum", branch="master", subdir="ex2" )## End(Not run)Create a zip Archive From an Existing Repository
Description
zipLocalRepo andzipRemoteRepo create a zip archive from anexistingRepository.zipLocalRepo zips localRepository,zipRemoteRepo zipsRepository stored on Github.
Usage
zipLocalRepo( repoDir = aoptions("repoDir"), repoTo = getwd(), zipname = "repository.zip")zipRemoteRepo( repoTo = getwd(), user = aoptions("user"), repo = aoptions("repo"), branch = "master", subdir = aoptions("subdir"), repoType = aoptions("repoType"), zipname = "repository.zip")Arguments
repoDir | A character that specifies the directory of the Repository whichwill be zipped. |
repoTo | A character that specifies the directory in which therewill be created zip archive from |
zipname | A character that specifies name of the zipped repository.It is assumed that this file does not exist or does not contain backpack.db file.An attempt to override will produce an error. |
user | While working with the Remote repository. A character containinga name of the Remote user on whose account the |
repo | While working with the Remote repository. A character containinga name of the Remote repository on which the Repository, which is to be zipped, is archived.By default set to |
branch | While working with the Remote repository. A character containing a name of theRemote repository's branch on which Repository, which is to be zipped, is archived.Default |
subdir | While working with a Remote repository. A character containing a name ofa directory on Remote repository on which the Repository, which is to be zipped, is stored.If the Repository is stored in the main folder on the Remote repository, this should be set to FALSE as default. |
repoType | A character containing a type of the remote repository. Currently it can be 'Remote' or 'bitbucket'. |
Contact
Bug reports and feature requests can be sent tohttps://github.com/pbiecek/archivist/issues
Note
The function might not work ifRtools are not installed.
Ifrepo anduser are set toNULL (as default) in Github mode then global parametersset insetRemoteRepo function are used.
Author(s)
Marcin Kosinski,m.p.kosinski@gmail.com, Przemyslaw Biecek
References
Biecek P and Kosinski M (2017). "archivist: An R Package for Managing,Recording and Restoring Data Analysis Results." _Journal of StatisticalSoftware_, *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(),archivistPackage,aread(),areadLocal(),asearch(),asearchLocal(),asession(),atrace(),cache(),copyLocalRepo(),createLocalRepo(),createMDGallery(),deleteLocalRepo(),getRemoteHook(),getTagsLocal(),loadFromLocalRepo(),md5hash,removeTagsRepo(),restoreLibs(),rmFromLocalRepo(),saveToLocalRepo(),searchInLocalRepo(),setLocalRepo(),shinySearchInLocalRepo(),showLocalRepo(),splitTagsLocal(),summaryLocalRepo()
Other archivist:Repository,Tags,%a%(),addHooksToPrint(),addTagsRepo(),aformat(),ahistory(),alink(),aoptions(),archivistPackage,aread(),areadLocal(),asearch(),asearchLocal(),asession(),atrace(),cache(),copyLocalRepo(),createLocalRepo(),createMDGallery(),deleteLocalRepo(),getRemoteHook(),getTagsLocal(),loadFromLocalRepo(),md5hash,removeTagsRepo(),restoreLibs(),rmFromLocalRepo(),saveToLocalRepo(),searchInLocalRepo(),setLocalRepo(),shinySearchInLocalRepo(),showLocalRepo(),splitTagsLocal(),summaryLocalRepo()
Examples
# objects preparation## Not run: # data.frame objectdata(iris)# ggplot/gg objectlibrary(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)# Local versionexampleRepoDir <- tempfile()createLocalRepo( repoDir = exampleRepoDir )saveToLocalRepo( myplot123, repoDir=exampleRepoDir )saveToLocalRepo( iris, repoDir=exampleRepoDir )saveToLocalRepo( model, repoDir=exampleRepoDir ) zipLocalRepo( exampleRepoDir )deleteLocalRepo( exampleRepoDir, TRUE)rm( exampleRepoDir )# Remote versionzipRemoteRepo( user="MarcinKosinski", repo="Museum", branch="master", subdir="ex1" )zipRemoteRepo( user="pbiecek", repo="archivist", repoTo = getwd( ) )## End(Not run)