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.
Arguments
- remote
Description of the location. Typically this is a character string indicating a remote specified in the
remotes
block of yourorderly_config.yml
. It is also possible to pass in a directly created remote object (e.g., usingorderly_remote_path()
, or one provided by another package). If leftNULL
, 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 iflocate
isTRUE
.- locate
Logical, indicating if the configuration should be searched for. If
TRUE
andconfig
is not given, then orderly looks in the working directory and up through its parents until it finds anorderly_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()
#> [1] "changelog" "connection" "default-param"
#> [4] "global" "html" "interactive"
#> [7] "minimal" "multi-artefact" "multifile-artefact"
#> [10] "other" "slow1" "slow10"
#> [13] "slow3" "spaces" "use_dependency"
#> [16] "use_dependency_2" "use_resource" "use_resource_dir"
#> [19] "view"