print.DescrList: S3 override for print function for DescrList objects.

View source: R/descr.R

print.DescrListR Documentation

S3 override for print function for DescrList objects.

Description

This function takes a DescrList object and converts it to either a DescrPrintCharacter or DescrPrintNumeric object, depending on the print_format option. This object is then printed in an appropriate format.

Usage

## S3 method for class 'DescrList'
print(x, print_format = options("print_format")[[1]], silent = FALSE, ...)

Arguments

x

A DescrList object returned from descr.

print_format

Possible values: "console" (default), "tex", "html", "word", "numeric"

silent

I TRUE, suppresses output to stdout.

...

further arguments to be passed along to print method

Details

There is no way to convert between DescrPrintCharacter and DescrPrintNumeric objects. The first type is for what you would usually want, the second type is mostly for debugging purposes. A DescrPrintCharacter object can be printed as html, tex code, as a flextable object or simply to the console.

Value

A DescrPrint object which can be printed in various formats.

You can use the print_format option to control the output type. If you use 'DescrTab2' inside an .Rmd document, you can set the clobal option option(print_format="tex") or option(print_format="html") or option(print_format="word") depending on your document type. This way, all your tables will be printed in the right format by default inside this document.

Examples

print(descr(iris), print_format = "console")
print(descr(iris), print_format = "tex")
print(descr(iris), print_format = "html")
print(descr(iris), print_format = "word")
print(descr(iris), print_format = "numeric")
options(print_format = "tex")
descr(iris)
options(print_format = "console")
descr(iris)
DescrPrint <- print(descr(iris))
DescrPrint$variables$results$Sepal.Length$Total$mean
print(DescrPrint)

DescrTab2 documentation built on Sept. 6, 2022, 9:05 a.m.