Learn R Programming

btw (version 1.0.0)

btw_this.data.frame: Describe a data frame in plain text

Description

Describe a data frame in plain text

Usage

# S3 method for data.frame
btw_this(
  x,
  ...,
  format = c("skim", "glimpse", "print", "json"),
  max_rows = 5,
  max_cols = 100,
  package = NULL
)

# S3 method for tbl btw_this( x, ..., format = c("skim", "glimpse", "print", "json"), max_rows = 5, max_cols = 100, package = NULL )

Value

A character vector containing a representation of the data frame. Will error if the named data frame is not found in the environment.

Arguments

x

A data frame or tibble.

...

Additional arguments are silently ignored.

format

One of "skim", "glimpse", "print", or "json".

  • "skim" is the most information-dense format for describing the data. It uses and returns the same information as skimr::skim() but formatting as a JSON object that describes the dataset.

  • To glimpse the data column-by-column, use "glimpse". This is particularly helpful for getting a sense of data frame column names, types, and distributions, when pairings of entries in individual rows aren't particularly important.

  • To just print out the data frame, use print().

  • To get a json representation of the data, use "json". This is particularly helpful when the pairings among entries in specific rows are important to demonstrate.

max_rows

The maximum number of rows to show in the data frame. Only applies when format = "json".

max_cols

The maximum number of columns to show in the data frame. Only applies when format = "json".

package

The name of the package that provides the data set. If not provided, data_frame must be loaded in the current environment, or may also be inferred from the name of the data frame, e.g. "dplyr::storms".

Functions

  • btw_this(data.frame): Summarize a data frame.

  • btw_this(tbl): Summarize a tbl.

See Also

btw_tool_env_describe_data_frame()

Other btw formatting methods: btw_this(), btw_this.character(), btw_this.environment()

Other btw formatting methods: btw_this(), btw_this.character(), btw_this.environment()

Examples

Run this code
btw_this(mtcars)

btw_this(mtcars, format = "print")

btw_this(mtcars, format = "json")

Run the code above in your browser using DataLab