read_manifest: Read a file manifest for optional data files.

View source: R/manifest.R

read_manifestR Documentation

Read a file manifest for optional data files.

Description

Read a manifest that describes a set of optional data files, one file per row. A manifest is either a CSV file or a data.frame with the columns described below. Manifests can be written by hand or generated with write_manifest_from_dir.

Usage

read_manifest(manifest, base_url = NULL)

Arguments

manifest

string or data.frame. The manifest to read: either the path to a CSV file, or a data.frame that is used directly. Comment lines in a CSV manifest that start with # are ignored.

base_url

string or NULL. A base URL used to derive the download URL for all files that do not have an explicit URL. For such files, the URL is set to paste0(base_url, path). This is convenient when the remote directory layout mirrors the layout inside the package cache. Files with an explicit url entry are never modified.

Details

The manifest must contain a column named path, giving the file path relative to the package cache directory, using / as separator. Two further columns are optional:

  • url: The remote URL to download the file from. If empty (or missing), it is derived from base_url (see above).

  • md5: The MD5 checksum of the file, used to verify file integrity. If empty (or missing), no integrity check is performed for that file (only its existence is checked).

Additional columns are allowed and ignored.

Value

data.frame with the columns path, url and md5. The url column never contains missing values after this function ran: either it was present in the input, or it was derived from base_url and path. The md5 column may contain NA for files without a checksum.


pkgfilecache documentation built on Sept. 1, 2026, 1:08 a.m.