Skip to contents

Declare a dependency on another packet

Usage

orderly_dependency(name, query, files)

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, or data.frame objects) containing columns from and to, in which case the files from will be copied with names to.

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 directory here/... with files from the upstream packet directory there/. 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 from envir and substitute them into your string. This is similar to the interpolation you might be familiar with from glue::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}.

Value

Undefined

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.