R6ClassCount: R6 Class representing object counts in documents

R6ClassCountR Documentation

R6 Class representing object counts in documents

Description

Simple counter of objects inside a document. Objects that associated to such a counter can be sections, tables, diagrams and others. Specialised counter classes for the different document objects can be derived from this more generic counter class. Specific document objects that are associated to a counter are generated using the prefix field in this class.

Usage

R6ClassCount$new()

Public methods

new()

Instantiation of a new R6ClassCount object

out(ps_prefix, ps_suffix, pn_count)

Write count value with given prefix and suffix

increment_count()

Increment value of count by 1

set_prefix(ps_prefix)

Setter for field prefix

get_prefix()

Getter for field prefix

set_suffix(ps_suffix)

Setter for field suffix

get_suffix()

Getter for field suffix

set_count(pn_count)

Setter for field count

get_count()

Getter for field count

Public fields

prefix

Text shown before counter, specifies the document object type

suffix

Test shown after the counter, corresponds to a description

count

current value of the counter

Active bindings

prefix

Text shown before counter, specifies the document object type

suffix

Test shown after the counter, corresponds to a description

count

current value of the counter

Methods

Public methods


Method new()

Usage
R6ClassCount$new()

Method out()

Usage
R6ClassCount$out(ps_prefix = NULL, ps_suffix = NULL, pn_count = NULL)

Method increment_count()

Usage
R6ClassCount$increment_count()

Method set_prefix()

Usage
R6ClassCount$set_prefix(ps_prefix)

Method get_prefix()

Usage
R6ClassCount$get_prefix()

Method set_suffix()

Usage
R6ClassCount$set_suffix(ps_suffix)

Method get_suffix()

Usage
R6ClassCount$get_suffix()

Method set_count()

Usage
R6ClassCount$set_count(pn_count)

Method get_count()

Usage
R6ClassCount$get_count()

Method clone()

The objects of this class are cloneable with this method.

Usage
R6ClassCount$clone(deep = FALSE)
Arguments
deep

Whether to make a deep clone.

Examples

cnt <- R6ClassCount$new()
cat(cnt$out(ps_prefix = "## Task", ps_suffix="Variance components", pn_count = 1))


charlotte-ngs/rmdhelp documentation built on Oct. 31, 2023, 10:21 a.m.