colorDF: Make a dataframe colorful

View source: R/classes.R

colorDFR Documentation

Make a dataframe colorful

Description

Make a dataframe colorful

Usage

colorDF(x, theme = NULL)

as.colorDF(x, ...)

Arguments

x

a data frame or similar object, e.g. tibble, data.table or any object for which as.data.frame call returns a data frame

theme

Which theme to use

...

further arguments are passed to colorDF().

Details

These functions turn any data frame like object (i.e. object which inherits the data.frame class, such as a tibble or a data table).

Apart from adding the S3 class "colorDF", the .style attribute (and later the .coltp attribute), the only thing that really changes is the print method (see print_colorDF()). In other words, the behavior of the object does not change (e.g., a base::data.frame() will by the default drop dimensions if one column is selected, while a tibble::tibble() will not). colorDF is just for visualization, never truly manipulation.

Several color themes come with the package; see colorDF_themes_show(). When creating a colorful data frame, a theme might be directly selected; otherwise the getOption("colorDF_theme") is consulted and if NULL, a default theme will be selected. The theme associated with an object becomes a style and can be further manipulated (see df_style()).

as.colorDF() calls colorDF(); this function is only here for completeness.

Value

a colorful data frame – identical object but with the .style attribute set and class "colorDF" added.

See Also

Introduction to the package; df_style() on how to modify style of the colorful data frame; col_type() on how to change column types; colorDF_themes() to list all themes; colorDF_themes_show() to view all themes.

Examples

colorDF(mtcars)
colorDF(mtcars, theme="bw")

colorDF documentation built on Sept. 26, 2022, 5:06 p.m.