d2.data.frame: Generate D2 input text to plot a data frame

View source: R/plot.r

d2.data.frameR Documentation

Generate D2 input text to plot a data frame

Description

Produces text input for D2 to make a diagram of a given data frame, usually rendered with SVG.

Usage

## S3 method for class 'data.frame'
d2(x, name = NA_character_, ...)

Arguments

x

a data.frame.

name

a character scalar, giving the name of the record, if any. The name must be non-empty, since it is also used to name the single table in the plot. Defaults to NA: if left missing, it is set to "data".

...

further arguments passed to or from other methods.

Details

The rows in the plotted data frame include information about the attribute classes.

Value

A scalar character, containing text input for Graphviz.

See Also

The generic d2.


autodb documentation built on Nov. 5, 2025, 6:49 p.m.