Verify a supplementary resources manifest against a directory or archive
Source:R/add_suppl_resources.R
check_supplementary.RdA pass/fail check confirming that your finalised manifest accurately
describes the content of the supplementary archive/directory and is ready
for submission. suppl_res must be a finalised manifest, i.e. including
the status column produced by compile_resources() or
recompile_resources().
Aborts if suppl_res lists a file with status == "ok" that isn't found
in path—a genuine inconsistency between the manifest and the archive.
Returns FALSE (with a warning pointing you back to
recompile_resources()) if any resource still needs review, or TRUE if
everything is ready.
Arguments
- suppl_res
An existing resources data frame.
- path
Path to a directory to scan for files, or to an existing (non-nested) zip archive to read the file list from directly. Reading a zip archive requires the zip package, and does not extract any files—
fname_resourceisNAfor resources found this way.- rxs_images
A QWAimages object. Its
roxas_versionattribute is used to disambiguate resource-type patterns shared between classic ROXAS and ROXAS AI, and itsorg_img_name,image_label,slide_label, andwoodpiece_labelcolumns are used to auto-populatelinked_labelwhere appropriate.
Examples
if (FALSE) { # \dontrun{
# verify a finalized manifest against an already-zipped submission
suppl_res <- vroom::vroom("output_data/supplementary_files.csv",
show_col_types = FALSE)
if (!check_supplementary(suppl_res, "supplementary_data.zip", rxs_images = my_images)) {
suppl_res <- recompile_resources(suppl_res, "supplementary_data", rxs_images = my_images)
# fix the flagged resource(s) in suppl_res, then check again
}
} # }