### Local version
if (FALSE) {
## EXAMPLE with pipe operator %a%
# Creating empty repository
exampleRepoDir <- tempfile()
createLocalRepo( exampleRepoDir )
library(dplyr)
data(mtcars)
setLocalRepo(repoDir = exampleRepoDir)
hash <- mtcars %a%
group_by(cyl, am) %a%
select(mpg, cyl, wt, am) %a%
summarise(avgmpg = mean(mpg), avgwt = mean(wt)) %a%
filter(avgmpg > 20) %a%
saveToRepo( exampleRepoDir )
showLocalRepo(exampleRepoDir)
showLocalRepo(exampleRepoDir, method = "tags")
# We search for a Tag with default "name" regular expression corresponding to
# hash md5hash.
getTagsLocal( md5hash = hash, exampleRepoDir )
# Deleting example respository
deleteLocalRepo( exampleRepoDir, TRUE)
rm( exampleRepoDir )
## EXAMPLE with data iris
exampleRepoDir <- tempfile()
createLocalRepo( exampleRepoDir )
data(iris)
saveToRepo(iris, repoDir = exampleRepoDir )
showLocalRepo(exampleRepoDir)
showLocalRepo(exampleRepoDir, method = "tags")
# We can notice that there is only one md5hash
# (and second for archiveSessionInfo) in repo so we will use it
hash <- showLocalRepo(exampleRepoDir)[1,1]
# We search for a Tag with "varname" regular expression corresponding to
# hash md5hash.
getTagsLocal( md5hash = hash, exampleRepoDir, tag = "varname" )
# There are 5 different Tags with "varname" regular expression
# We needn't use the whole expression "varname". We may use its abbreviation
# and get the same result.
getTagsLocal( md5hash = hash, exampleRepoDir, tag = "varna" )
deleteLocalRepo( exampleRepoDir, TRUE)
rm( exampleRepoDir )
### Remote version
## EXAMPLE: pbiecek archivist repository on GitHub
showRemoteRepo(user="pbiecek", repo="archivist")
# We search for a Tag with default "name" regular expression corresponding to
# "cd6557c6163a6f9800f308f343e75e72" md5hash.
getTagsRemote( "cd6557c6163a6f9800f308f343e75e72",
user="pbiecek", repo="archivist")
## EXAMPLE: many archivist-like Repositories on one Github repository
# We search for a Tag with default "name" regular expression corresponding to
# "ff575c261c949d073b2895b05d1097c3" md5hash.
getTagsRemote("ff575c261c949d073b2895b05d1097c3", user="MarcinKosinski",
repo="Museum", branch="master", subdir="ex1")
}
Run the code above in your browser using DataLab