section: Create a section in a list (collection of functions and other...

View source: R/section.R

sectionR Documentation

Create a section in a list (collection of functions and other objects).

Description

A section tags a list to sort its items. It is particularly useful when you create a collection of function (or other objects) to ease the access to these functions. Sections are displayed in printed and "str"ed versions of the list and are also functions that cut the list to the section content only. get_section() is the workhorse function that does the section extraction.

Usage

section(obj, title)

## S3 method for class 'section'
print(x, ...)

## S3 method for class 'section'
str(object, ...)

get_section(x, title)

Arguments

obj

A list object.

title

The title of the section. It must match the name of the list item. For a title "My section title", the name must be "0__MY_SECTION_NAME__" that is both a syntactically correct name and something that emphasizes the entry as a title.

x

A list containing the section

...

Further arguments (not used yet)

object

A list to use for section extraction

Value

A function that is able to extract the corresponding section from the list.

Examples

#TODO...

SciViews/svMisc documentation built on Sept. 15, 2023, 3:51 a.m.