find_consensus_path: Identify shared path of subdirectories

Description Usage Arguments Value Example Usage NOTE

View source: R/find_consensus_path.R

Description

Identify the recursive path (subdirectories) which most files have in common within a specified directory.

Usage

1
find_consensus_path(top_lvl_dir)

Arguments

top_lvl_dir

the path to the directory to search within

Value

a file path, beginning with top_lvl_dir

Example Usage

Identify the consensus path of an renv project library when other unrelated and less file-dense directories are present in a given top-level directory. (I used this on a HPCC to determine where R files were being installed to when setting up R with renv and conda.)

NOTE

This is a first-pass implementation and may be slow. The implementation identifies all files recursively below the specified directory and returns the file path shared by the majority of files (currently 80%).


allenbaron/JABmisc documentation built on July 4, 2021, 9:56 a.m.