check_duplicate_paths: Check for duplicated file paths

Description Usage Arguments Details Value Examples

View source: R/check-duplicate-paths.R

Description

The parent column in the manifest should not contain duplicated file paths. This function checks if any paths are duplicated.

Usage

1
2
3
4
5
check_duplicate_paths(
  data,
  success_msg = "No duplicate file paths detected",
  fail_msg = "Duplicate file paths detected"
)

Arguments

data

Data to check

success_msg

Message indicating the check succeeded.

fail_msg

Message indicating the check failed.

Details

It is possible for this function to return false negatives if the same path is written in different ways. For example, "~/file.txt" and "/Users/me/file.txt" will be treated as different paths even if they resolve to the same location on the user's machine. Because this function is typically run from a Shiny app without access to the user's filesystem, it is not possible to detect every possible duplicate path.

Value

A condition object indicating whether the data contains duplicated file paths in the parent column.

Examples

1
2
3
4
5
manifest <- data.frame(
  path = c("/path/to/file.txt", "/path/to/file.txt"),
  parent = c("syn123", "syn123")
)
check_duplicate_paths(manifest)

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