print.huxtable: Format and print huxtables using a default method

Description Usage Arguments Value See Also Examples

View source: R/misc.R

Description

By default huxtables are printed using print_screen(). In certain cases, for example in Sweave documents, it may be useful to change this. You can do so by setting options("huxtable.print").

Usage

1
2
3
4
5
## S3 method for class 'huxtable'
print(x, ...)

## S3 method for class 'huxtable'
format(x, ..., output = c("latex", "html", "md", "screen", "rtf"))

Arguments

x

A huxtable.

...

Options passed to other methods.

output

Output format. One of "html", "latex", "md", "screen" or "rtf".

Value

print prints the huxtable and returns NULL invisibly.

format returns a string representation from to_latex(), to_html() etc.

See Also

To change how huxtables are printed within knitr, see options("huxtable.knitr_output_format") in huxtable-options

Examples

1
2
3
4
5
6
7
8
## Not run: 
  # to print LaTeX output:
  options(huxtable.print = print_latex)

## End(Not run)

format(jams, output = "screen")
format(jams, output = "md")

Example output

[1] "  Type           Price  \n  Strawberry      1.90  \n  Raspberry       2.10  \n  Plum            1.80  \n\nColumn names: Type, price\n"
[1] "-----------------------\n Type            Price \n----------- -----------\n Strawberry       1.90 \n                       \n Raspberry        2.10 \n                       \n Plum             1.80 \n-----------------------\n\n"

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