Verify a supplementary resources manifest against a directory or archive
Source:R/supplementary.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. A submission-time check: it applies to the submitted
supplementary CSV (with status), not to the supplementary CSV of TRIA
dataset files. suppl_res must be a finalised manifest, i.e. including
the status column produced by compile_supplementary() or
recompile_supplementary().
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. System files (e.g..DS_Store,Thumbs.db,__MACOSX/entries) are skipped.- 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.- strict
If
TRUE, abort on the first issue instead of warning.
Details
Warns (or, with strict = TRUE, aborts) on:
files with
status == "ok"insuppl_resnot found inpath;files in
pathnot declared insuppl_res(junk files aside);resources that still need review (fix them and run
recompile_supplementary());schema issues of the manifest.
Junk files and manual corrections in suppl_res are reported as
information.
Examples
if (FALSE) { # \dontrun{
# verify a finalised 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_supplementary(suppl_res, "supplementary_data", rxs_images = my_images)
# fix the flagged resource(s) in suppl_res, then check again
}
} # }