overview_generation: Generate construct overviews and instruction overviews

generate_construct_overviewR Documentation

Generate construct overviews and instruction overviews

Description

These functions use a DCT specification to generate a construct overview or an instruction overview.

Usage

generate_construct_overview(
  dctSpec,
  include = c("definition", "measure_dev", "measure_code", "manipulate_dev",
    "manipulate_code", "aspect_dev", "aspect_code", "rel"),
  hideByDefault = NULL,
  divClass = "btn btn-secondary",
  headingLevel = 3,
  collapseButtons = TRUE,
  hyperlink_UCIDs = TRUE,
  HTMLoutput = FALSE,
  urlPrefix = "#",
  sortDecreasing = FALSE
)

generate_definitions_overview(
  dctSpecDf,
  headingLevel = 3,
  hyperlink_UCIDs = "Markdown",
  urlPrefix = "#",
  sortDecreasing = FALSE
)

generate_instruction_overview(
  dctSpecDf,
  type,
  headingLevel = 3,
  hyperlink_UCIDs = "Markdown",
  urlPrefix = "#",
  sortDecreasing = FALSE
)

Arguments

dctSpec

The DCT specification, as resulting from a call to load_dct_specs() or load_dct_dir().

include

Which elements to include in the construct overview.

hideByDefault

Which elements to hide by default.

divClass

The class of the button to collapse/expand sections.

headingLevel

The level of the heading in the Markdown output that is produces.

collapseButtons

Whether to include buttons to show/hide the definition and instructions.

hyperlink_UCIDs

Whether to create hyperlinks to UCIDs.

HTMLoutput

Whether to output to Markdown (FALSE) or HTML (TRUE).

urlPrefix

The prefix to insert before the URL in the produced hyperlink. The default, "#", results in a link to an anchor (an HTML a element) on the current page.

sortDecreasing

Whether to sort the constructs in decreasing order (TRUE), in increasing order (FALSE), or not at all (NULL).

dctSpecDf

The DCT specification dataframer, as produced by a call to load_dct_specs() or load_dct_dir(), and stored within the resulting object.

type

For instruction overviews, the type of instruction to generate can be specified: must be one of "measure_dev", "measure_code", "manipulate_dev", "manipulate_code", "aspect_dev", or "aspect_code".

Value

A character string with the overview.

Examples

exampleDCT <-
  psyverse::dct_object(
    prefix = "exampleConstruct",
    label = "An example construct",
    definition = "The definition goes here",
    measure_dev = "Here you can explain how to measure the construct"
  );
generate_construct_overview(exampleDCT);

psyverse documentation built on March 7, 2023, 8:31 p.m.