colorize: Colorize a source text

Description Usage Arguments Details Examples

Description

Summarize a text model by visualizing a source text

Usage

1
2
3
4
5
6
7
colorize(data, tokens, source, background = NULL, color = NULL,
  bold = NULL, italic = NULL, underline = NULL, format = c("html",
  "latex", "shiny", "console"), snippet = TRUE, ...)

colorise(data, tokens, source, background = NULL, color = NULL,
  bold = NULL, italic = NULL, underline = NULL, format = c("html",
  "latex", "shiny", "console"), snippet = TRUE, ...)

Arguments

data

A data frame containg something summarizing a model.

tokens

A character string specifying the column in data that contains tokens/words/etc. to colorize.

source

A character vector specifying a source text to format.

background

A character string specifying a variable name from data to be used in dictating the background color of the text.

color

A character string specifying a variable name from data to be used in dictating the font color of the text.

bold

A character string specifying a variable name from data to be used in dictating whether to bold the text.

italic

A character string specifying a variable name from data to be used in dictating whether to italicize the text.

underline

A character string specifying a variable name from data to be used in dictating whether to underline the text.

format

A character string specifying an output format.

snippet

A logical indicating whether to provide just a code snippet (the default) or a complete document.

...

TBD

font

A character string specifying a variable name from data to be used in dictating the font face/family of the text.

size

A character string specifying a variable name from data to be used in dictating the fotn size of the text.

Details

LaTeX support requires the xcolor package in the document header.

Examples

1
2
data("billSection", package = "textcolor")
colorize(test_data[!test_data$terms %in% c("a", "an"),], tokens = "terms", background = "class", source = document)

leeper/textcolor documentation built on May 21, 2019, 1:39 a.m.