add.provenance: Add data provenance to a list

add.provenanceR Documentation

Add data provenance to a list

Description

This function will add a custom data provenance entry in the markdown-based format used by the borealis package. While designed for use with shape data structures, the function should be compatible with any list (or an atomic vector that can be coerced by base::as.list.

Usage

add.provenance(
  x,
  name = NULL,
  title = NULL,
  user = NULL,
  date = NULL,
  text = NULL,
  markdown = TRUE
)

Arguments

x

A list object

name

A string identifying the data provenance entry (defaults to title without white space)

title

A string titling the data provenance entry (defaults to name)

user

A string identifying the user (defaults to Sys.getenv("LOGNAME"))

date

A string for the date and time associated with the provenance (defaults to the current system date and time)

text

A string containing the main text of the data provenance entry

markdown

A logical argument specifying whether markdown formatting should be applied

Source

Dave Angelini david.r.angelini@gmail.com [aut, cre]

Examples

data("plethodon", package = "geomorph")

pleth <- add.provenance(
  plethodon,
  name="acquisition",
  title = "Loaded example dataset",
  text = "Started a **training analysis** using the `plethodon` dataset,
  which is included in the excellent
  [`geomorph` package](https://cran.r-project.org/web/packages/geomorph/)" )

str(pleth)

cat(pleth$provenance$acquisition)


aphanotus/borealis documentation built on Nov. 4, 2022, 8:44 p.m.