Learn R Programming

archivist (version 1.5)

setLocalRepo: Set Global Path to Repository

Description

setLocalRepo sets global path to the Repository. If you are working on a Local Repository and are tired of specifying repoDir argument with every call of a function that works with the Repository, you can set the path globally using setLocalRepo function and than ommit repoDir parameter in future calls. setGithubRepo similarly sets path to the Github Repository stored on a Github. See examples.

Usage

setLocalRepo(repoDir)

setGithubRepo(user, repo, branch = "master", repoDirGit = NULL)

Arguments

repoDir
A character denoting an existing directory of a Rpoesiotry that will be used in functions: saveToRepo, loadFromLocalRepo, search
user
Only if working with a Github repository. A character containing a name of a Github user that will be used in functions: zipGithubRepo, loadFromGithubRepo,
repo
Only if working with a Github repository. A character containing a name of a Github repository that will be used in functions: zipGithubRepo, loadFromGithubRepo,
branch
Only if working with a Github repository. A character containing a name of Github Repository's branch that will be used in functions: zipGithubRepo, loadFromGithubRepo
repoDirGit
Only if working with a Github repository. A character containing a name of a directory on Github repository on which the Repository is stored that will be used in functions: zipGithubRepo,

Details

setLocalRepo sets a global path to the Repository. If you are working on a Local Repository and are tired of specifying a repoDir paremeter with every call of a function that works with the Repository, you can set the path globally using setLocalRepo function and than ommit the repoDir parameter in future calls. setGithubRepo similarly sets path to the Github Repository stored on a Github. See examples.

See Also

https://github.com/pbiecek/archivist/wiki{https://github.com/pbiecek/archivist/wiki}

Other archivist: Repository; Tags; %a%; addTagsRepo; ahistory, print.ahistory; archivist-package; aread; asearch; cache; copyGithubRepo, copyLocalRepo; createEmptyRepo; deleteRepo; getTagsGithub, getTagsLocal; loadFromGithubRepo, loadFromLocalRepo; md5hash; multiSearchInGithubRepo, multiSearchInLocalRepo, searchInGithubRepo, searchInLocalRepo; rmFromRepo; saveSetToRepo; saveToRepo; shinySearchInLocalRepo; showGithubRepo, showLocalRepo; summaryGithubRepo, summaryLocalRepo; zipGithubRepo, zipLocalRepo

Other archivist: Repository; Tags; %a%; addTagsRepo; ahistory, print.ahistory; archivist-package; aread; asearch; cache; copyGithubRepo, copyLocalRepo; createEmptyRepo; deleteRepo; getTagsGithub, getTagsLocal; loadFromGithubRepo, loadFromLocalRepo; md5hash; multiSearchInGithubRepo, multiSearchInLocalRepo, searchInGithubRepo, searchInLocalRepo; rmFromRepo; saveSetToRepo; saveToRepo; shinySearchInLocalRepo; showGithubRepo, showLocalRepo; summaryGithubRepo, summaryLocalRepo; zipGithubRepo, zipLocalRepo

Examples

Run this code
# examples
exampleRepoDir <- tempdir()
createEmptyRepo( repoDir = exampleRepoDir )
saveToRepo( iris, exampleRepoDir)
setLocalRepo( exampleRepoDir )
saveToRepo( swiss )
showLocalRepo( exampleRepoDir )

iris2 <- loadFromLocalRepo( "ff575c2" , value = TRUE)
head(iris2, 2)

searchInLocalRepo( "name:i", fixed = F)

getTagsLocal( "ff575c261c949d073b2895b05d1097c3" )

rmFromRepo( "4c43f" )
showLocalRepo( )
summaryLocalRepo( )

deleteRepo( exampleRepoDir )
rm( exampleRepoDir )

## Github version
setGithubRepo( user="MarcinKosinski", repo="Museum", branch="master",
repoDirGit="ex1" )

loadFromGithubRepo( "ff575c261c949d073b2895b05d1097c3")
this <- loadFromGithubRepo( "ff", value = T)
zipGithubRepo( )
searchInGithubRepo( "name:", fixed= FALSE)
getTagsGithub("ff575c261c949d073b2895b05d1097c3")

summaryGithubRepo( )
showGithubRepo( )

setGithubRepo( user="pbiecek", repo="archivist" )

multiSearchInGithubRepo( patterns=c("varname:Sepal.Width", "class:lm", "name:myplot123"),
                         intersect = FALSE )

Run the code above in your browser using DataLab