Declare a dependency on another packet
Arguments
- name
The name of the packet to depend on
- query
The query to search for; often this will simply be the string
latest
, indicating the most recent version. You may want a more complex query here though.- files
Files to copy from the other packet. This can be (1) a character vector, in which case files are copied over without changing their names, (2) a named character vector, in which case the name will be used as the destination name, or (3) a data.frame (including
tbl_df
, ordata.frame
objects) containing columnsfrom
andto
, in which case the filesfrom
will be copied with namesto
.In all cases, if you want to import a directory of files from a packet, you must refer to the source with a trailing slash (e.g.,
c(here = "there/")
), which will create the local directoryhere/...
with files from the upstream packet directorythere/
. If you omit the slash then an error will be thrown suggesting that you add a slash if this is what you intended.You can use a limited form of string interpolation in the names of this argument; using
${variable}
will pick up values fromenvir
and substitute them into your string. This is similar to the interpolation you might be familiar with fromglue::glue
or similar, but much simpler with no concatenation or other fancy features supported.Note that there is an unfortunate, but (to us) avoidable inconsistency here; interpolation of values from your environment in the query is done by using
environment:x
and in the destination filename by doing${x}
.
Details
See orderly_run for some details about how search
options are used to select which locations packets are found from,
and if any data is fetched over the network. If you are running
interactively, this will obviously not work, so you should use
orderly_interactive_set_search_options()
to set the
options that this function will respond to.