orderly_remote {orderly} | R 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
|
root |
The path to an orderly root directory, or |
locate |
Logical, indicating if the configuration should be
searched for. If |
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()