to_screen: Print a huxtable on screen

Description Usage Arguments Details Value See Also Examples

Description

Print a huxtable on screen

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
print_screen(ht, ...)

to_screen(ht, ...)

## S3 method for class 'huxtable'
to_screen(
  ht,
  min_width = ceiling(getOption("width")/6),
  max_width = getOption("width", Inf),
  compact = TRUE,
  colnames = TRUE,
  color = getOption("huxtable.color_screen", default = TRUE),
  ...
)

Arguments

ht

A huxtable.

...

Passed on to to_screen.

min_width

Minimum width in on-screen characters of the result.

max_width

Maximum width in on-screen characters of the result. Overrides min_width.

compact

Logical. To save space, don't print lines for empty horizontal borders.

colnames

Logical. Whether or not to print colum names.

color

Logical. Whether to print the huxtable in color (requires the crayon package).

Details

Screen display shows the following features:

Cell padding, widths and heights are not shown, nor are border styles.

Value

to_screen returns a string. print_screen prints the string and returns NULL.

See Also

Other printing functions: print_html(), print_latex(), print_md(), print_rtf()

Examples

1
2
3
4
5
6
bottom_border(jams)[1, 1:2] <- 1
bold(jams)[1, 1:2] <- TRUE
jams <- map_text_color(jams,
      by_regex("berry" = "red"))

print_screen(jams)

Example output

  Type           Price  
<U+2500><U+2500><U+2500><U+2500><U+2500><U+2500><U+2500><U+2500><U+2500><U+2500><U+2500><U+2500><U+2500><U+2500><U+2500><U+2500><U+2500><U+2500><U+2500><U+2500><U+2500><U+2500><U+2500><U+2500>
  Strawberry      1.90  
  Raspberry       2.10  
  Plum            1.80  

Column names: Type, price

huxtable documentation built on May 15, 2021, 1:09 a.m.