Learn R Programming

formatters (version 0.5.0)

basic_matrix_form: Create spoof matrix form from a data.frame

Description

This is useful primarily for writing testing/examples, and as a starting point for more sophisticated custom matrix_form methods

Usage

basic_matrix_form(df, parent_path = "root")

Value

A valid MatrixPrintForm object representing df, ready for ASCII rendering

Arguments

df

data.frame

parent_path

character. parent path that all rows should be "children of", defaults to "root", and generally should not matter to end users.

Examples

Run this code
mform <- basic_matrix_form(mtcars)
cat(toString(mform))

Run the code above in your browser using DataLab