repo_open: Open an existing repository or create a new one.

View source: R/repo.R

repo_openR Documentation

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.

Usage

repo_open(root = normalizePath(file.path("~", ".R_repo"), mustWork = F),
  force = F)

Arguments

root

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

force

Don't ask for confirmation.

Value

An object of class repo.

Examples

## 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)

repo documentation built on Aug. 5, 2026, 1:10 a.m.