Skip to content

Preview Metadata Files

The preview_metadata_files() function in the reportifyr package provides a summary of reportifyr metadata stored in .json files within a specified directory (file_dir).


preview_metadata_files()

R: Preview all metadata .json files in a directory
preview_metadata_filesR Documentation

Description

Preview all metadata .json files in a directory

Usage

preview_metadata_files(file_dir)

Arguments

file_dir

The file path to a directory containing metadata .json files.

Value

A data frame of metadata footnotes and meta type

Examples

## Not run: 
figures_path <- here::here("OUTPUTS", "figures")
preview_metadata_file(figures_path)

## End(Not run)

Returns

A data frame summarizing metadata for each .json file within a given file_dir.


Logging

  • Debug: Logs the start and end of the function, processing of each file, and successful extraction of metadata fields.
  • Info: Logs the file_dir validation, file discovery, and formatted metadata for each file.
  • Error: Logs issues such as a missing file_dir, no .json files found, or invalid metadata fields.

Additional Resources

  • reportifyr GitHub: Refer to the reportifyr repository for more details.
  • JSON Documentation: Learn more about JSON structure and syntax here.