archivist (version 1.1)

createEmptyRepo: Create an Empty Repository in a Given Directory

Description

createEmptyRepo creates an empty Repository in a given directory in which archived artifacts will be stored.

Usage

createEmptyRepo(repoDir, force = FALSE)

Arguments

repoDir
A character that specifies the directory for the Repository to be made.
force
If force = TRUE function call forces to create repoDir directory if it did not exist. Default set to force = FALSE.

Details

At least one Repository must be initialized before using other functions from the archivist package. When working in groups, it is highly recommended to create a Repository on a shared Dropbox/Git folder.

All artifacts desired to be archived are going to be saved in the local Repository, which is an SQLite database stored in a file named backpack. After calling saveToRepo function, every artifact will be archived in a md5hash.rda file. This file will be saved in a folder (under repoDir directory) named gallery. For every artifact, md5hash is a unique string of length 32 that comes out as a result of digest function, which uses a cryptographical MD5 hash algorithm.

To learn more about artifacts visit archivist-package.

Created backpack database is a useful and fundamental tool for remembering artifact's name, class, archiving date etc. (that are remembered as Tags), or for keeping artifact's md5hash.

Besides the backpack database, gallery folder is created in which all artifacts will be archived.

After every saveToRepo call the database is refreshed, so an artifact is available immediately in backpack.db database for other collaborators.

See Also

Other archivist: Repository; Tags; archivist-package; copyGithubRepo, copyLocalRepo; deleteRepo; getTagsGithub, getTagsLocal; loadFromGithubRepo, loadFromLocalRepo; md5hash; rmFromRepo; saveToRepo; searchInGithubRepo, searchInLocalRepo; showGithubRepo, showLocalRepo; summaryGithubRepo, summaryLocalRepo; tarGithubRepo, tarLocalRepo

Examples

Run this code
exampleRepoDir <- tempdir()
createEmptyRepo( repoDir = exampleRepoDir )

# check the state of an empty Repository

summaryLocalRepo(  repoDir = exampleRepoDir )
showLocalRepo( exampleRepoDir )

# creating a Repository in non existing directory

createEmptyRepo( "xyzdd234", force = TRUE )

# removing an example Repositories

deleteRepo( exampleRepoDir )
deleteRepo( "xyzdd234" )

rm( exampleRepoDir )

Run the code above in your browser using DataCamp Workspace