Open an existing repository or create a new one.

Description

If a repository does not exist at the specified location, creates a directory and stores the repository index in it. If a repository exists, the index is loaded and a repo object is built.

Arguments

root

Path to store data in. Defaults to "~/.R_repo".

force

Don't ask for confirmation.

Value

An object of class repo.

Examples

1
2
3
4
5
6
7
8
## Creates a new repository in a temporary directory without asking for
## confirmation.
rp_path <- file.path(tempdir(), "example_repo")
rp <- repo_open(rp_path, TRUE)
rp$put(0, "zero", "a random item", "a_tag")
rp$info()
## wiping temporary repo
unlink(rp_path, TRUE)