as_mdtable: Convert a data frame into an mdtable object.

View source: R/coercion.R

as_mdtableR Documentation

Convert a data frame into an mdtable object.

Description

Bundles a data frame with its R markdown reference and caption and file name for saving on the disc.

Usage

as_mdtable(x, ...)

## S3 method for class 'data.frame'
as_mdtable(x, label, ref_name, caption, ...)

## S3 method for class 'matrix'
as_mdtable(x, label, ref_name, caption, ...)

Arguments

x

a data frame or tibble.

...

extra arguments. In case of matrices, extra arguments passed to as.data.frame

label

the final file name.

ref_name

name of the reference to the table, used mainly in markdown documents.

caption

text to be presented in the table caption.

Details

Technically, a data frame with label, ref_name and caption attributes. The mdtable class inherits from data frame most of its methods. ref_name: needs to be a valid markdown/bookdown reference name. By default, spaces, slashes and underscores are silently turned into '-'.

Value

An object of class mdtable.


PiotrTymoszuk/figur documentation built on July 16, 2024, 1:15 a.m.