Skip to contents

repo_check(), code_check() and data_check() all classify a repository's files with data_classify_files(), into six categories: data, code, materials, documentation, output, and unknown. Splitting an upload calls the very same function, so a file cannot end up in one category when it is checked and another when it is archived.

Usage

.zenodo_classify(files)

Arguments

files

full paths to the files

Value

a character vector of categories, one per file

Details

That function reads names and paths only, never file contents, in three steps: a format-locked extension (a .sav is code, a .csv is data), then a category word used as a whole token in the path (Materials/, results.docx), then a crosswalk through the coarse file type, where image, audio, video, 3D, exec, config and font all become materials. Because nothing is opened, classifying costs no time even for a folder of very large files.