Skip to content

Update Object Footnotes

The update_object_footnotes() function in the reportifyr package updates the footnote metadata (equations [meta_equations], notes [meta_notes], or abbreviations [meta_abbrevs]) for a specified object or its associated metadata file.


update_object_footnotes()

R: Updates an object's footnote metadata - equations, notes, or...
update_object_footnotesR Documentation

Description

Updates an object's footnote metadata - equations, notes, or abbreviations

Usage

update_object_footnotes(
  file_path,
  overwrite = FALSE,
  meta_equations = NULL,
  meta_notes = NULL,
  meta_abbrevs = NULL
)

Arguments

file_path

The file path to the object or its metadata file.

overwrite

A boolean indicating whether to overwrite existing metadata entries. Default is FALSE (appends to existing entries).

meta_equations

A string or vector of strings representing equations to include or overwrite in the metadata.

meta_notes

A string or vector of strings representing notes to include or overwrite in the metadata.

meta_abbrevs

A string or vector of strings representing abbreviations to include or overwrite in the metadata.

Examples

## Not run: 
update_object_footnotes("example_metadata.json", equations = c("K10 = CL/VC", "K12 = Q/VC"))

## End(Not run)

Returns

If the metadata file exists, the function updates the metadata file at the specified file_path and returns a prompt stating:

Footnotes successfully updated in /cluster-data/user-homes/user/reportifyr_examples/OUTPUTS/figures/theoph-pk-exposure_png_metadata.json

If the metadata file does not exist, a prompt stating:

The metadata associated with the specified file does not exist: /cluster-data/user-homes/user/reportifyr_examples/OUTPUTS/figures/theoph-pk-exposure_png_metadata.json

Logging

  • Debug: Logs the start and end of the function and the successful loading of the metadata file.
  • Info: Logs when the metadata file is found and whether the metadata is being overwritten or appended.
  • Error: Logs errors for missing file_path.

Additional Resources

  • reportifyr GitHub: Refer to the reportifyr repository for more details.
  • JSON Documentation: Learn more about JSON structure and syntax here.
  • Get Meta Abbreviations Reference: Refer to the reference on get_meta_abbrevs() here.