check_files_manifest: Check that files are present in manifest

Description Usage Arguments Value Examples

View source: R/check-files-manifest.R

Description

Given a manifest and vector of file names, checks that the file names appear in the manifest. This is useful to ensure that metadata files (not just data files) are included in the manifest for upload.

Usage

1
2
3
4
5
6
7
check_files_manifest(
  manifest,
  filenames,
  strict = FALSE,
  success_msg = "All required files are present in manifest",
  fail_msg = "Some files may be missing from manifest"
)

Arguments

manifest

The manifest as a data frame or tibble

filenames

File names to look for in the path column of the manifest

strict

If FALSE, return a "check_warn" object; if TRUE, return a "check_fail" object

success_msg

Message indicating the check succeeded.

fail_msg

Message indicating the check failed.

Value

A condition object indicating whether the files are present in the path column of the manifest

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
manifest <- data.frame(
  path = c("individual_metadata.csv", "biospecimen_metadata.csv"),
  parent = c("syn123", "syn123")
)
check_files_manifest(
  manifest,
  c(
    "individual_metadata.csv",
    "biospecimen_metadata.csv",
    "assay_metadata.csv"
  )
)

dccvalidator documentation built on July 2, 2020, 4:05 a.m.