repo_copy: Copy items to another repository

Description Usage Arguments Value Examples

View source: R/repo_public.R

Description

Copies an object file from one repository to another and creates a new entry in the index of the destination repository. Supports tags and multiple names.

Usage

1
repo_copy(destrepo, name, tags = NULL, replace = F, confirm = T)

Arguments

destrepo

An object of class repo (will copy to it)

name

The name (or list of names) of the item/s to copy

tags

If not NULL, copy all items matching tags. NULL by default.

replace

What to do if item exists in destination repo (see put). F by default.

confirm

If F, don't ask for confirmation when multiple items are involved. F by default.

Value

Used for side effects.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
## Repository creation
rp_path1 <- file.path(tempdir(), "example_repo1")

rp1 <- repo_open(rp_path1, TRUE)
rp1$put(0, "item1", "A sample item", "tag1")
rp_path2 <- file.path(tempdir(), "example_repo2")
rp2 <- repo_open(rp_path2, TRUE)
rp1$copy(rp2, "item1")

## wiping temporary repo
unlink(rp_path1, TRUE)
unlink(rp_path2, TRUE)

franapoli/repo documentation built on May 17, 2021, 7:24 p.m.