orderly_remote: Get a remote

View source: R/remote.R

orderly_remoteR Documentation

Get a remote

Description

Get a remote, based on the configuration in orderly_config.yml - different remote drivers have different methods, and this function gives you access to these lower-level objects.

Usage

orderly_remote(remote = NULL, root = NULL, locate = TRUE)

Arguments

remote

Description of the location. Typically this is a character string indicating a remote specified in the remotes block of your orderly_config.yml. It is also possible to pass in a directly created remote object (e.g., using orderly_remote_path(), or one provided by another package). If left NULL, then the default remote for this orderly repository is used - by default that is the first listed remote.

root

The path to an orderly root directory, or NULL (the default) to search for one from the current working directory if locate is TRUE.

locate

Logical, indicating if the configuration should be searched for. If TRUE and config is not given, then orderly looks in the working directory and up through its parents until it finds an orderly_config.yml file.

Value

The orderly remote, as described in orderly_config.yml - if no remotes are configured, or if the requested remote does not exist, an error will be thrown.

See Also

orderly_pull_dependencies() which provides a higher-level interface to pulling from a remote (including adding the downloaded archive into your orderly repository), and see the documentation underlying the orderly remote driver that your orderly_config.yml declares for information about using that remote.

Examples

## We need two orderly repositories here - one as a "local" and one as
## a "remote" (see ?orderly_pull_archive)
path_remote <- orderly::orderly_example("demo")
path_local <- orderly::orderly_example("demo")

## Configure our remote:
path_config <- file.path(path_local, "orderly_config.yml")
txt <- readLines(path_config)
writeLines(c(
  txt,
  "remote:",
  "  default:",
  "    driver: orderly::orderly_remote_path",
  "    args:",
  paste("      path:", path_remote)),
  path_config)

## Get our remote:
remote <- orderly::orderly_remote(root = path_local)

## Can use the remote's methods to interact directly - actual methods
## depend on the remote driver being used.
remote$list_reports()

vimc/orderly documentation built on July 8, 2023, 2:31 a.m.