Learn R Programming

fdth (version 1.3-0)

xtable.fdt: LaTeX table of the frequency distribution table

Description

This function returns a LaTeX table of the fdt, fdt.multiple and fdt_cat.multiple objects of the xtable class.

Usage

# S3 method for fdt
xtable(x,
       caption = NULL,
       label = NULL,
       align = NULL,
       digits = NULL,
       display = NULL,
       auto = FALSE,
       ...)

# S3 method for fdt.multiple xtable(x, caption = NULL, label = NULL, align = NULL, digits = NULL, display = NULL, ...)

# S3 method for fdt_cat.multiple xtable(x, caption = NULL, label = NULL, align = NULL, digits = NULL, display = NULL, ...)

Value

An object of the class xtable.fdt, xtable.fdt.multiple and xtable.fdt_cat.multiple.

Arguments

x

A fdt, fdt.multiple or fdt_cat.multiple class object.

caption

Character vector of length 1 or 2 containing the table's caption or title. See xtable function to more details.

label

Character vector of length 1 containing the LaTeX label or HTML anchor. See xtable function to more details.

align

Character vector of length equal to the number of columns of the resulting table, indicating the alignment of the corresponding columns. See xtable function to more details.

digits

Numeric vector of length equal to one (in which case it will be replicated as necessary) or to the number of columns of the resulting table or matrix of the same size as the resulting table, indicating the number of digits to display in the corresponding columns. See xtable function to more details.

display

Character vector of length equal to the number of columns of the resulting table, indicating the format for the corresponding columns. See xtable function to more details.

auto

Logical, indicating whether to apply automatic format when no value is passed to align, digits, or display

...

Additional arguments.

Author

Faria, J. C.
Allaman, I. B
Jelihovschi, E. G.

Details

The functions latex.fdt was deprecated. We understand over the years that creating a method for the generic xtable function would be inevitable, given the advancement of the xtable package and its support by the academic community.

Then, the fdt, fdt.multiple and fdt_cat.multiple methods were created for the generic xtable function. For object of the fdt_cat class, no methods were created, as they inherit the data.frame class, and therefore, the xtable functions can be used directly for such objects.

Objects of the fdt.multiple and fdt_cat.multiple class, when using the xtable function, will have the xtableList class. Although it may seem confusing, the xtableList function in the xtable package has no generic function and therefore it was not possible to create a method of type xtableList.fdt.multiple. Therefore, a method of the xtable.fdt.multiple class was created, but the function xtableList is being used internally.

More examples than those provided in the manual can be seen in the vignette.

It is possible to select what columns of the table (a data.frame) will be shown, as well as the pattern of the first column. The columns are:

  1. Class limits

  2. f - Absolute frequency

  3. rf - Relative frequency

  4. rf(%) - Relative frequency, %

  5. cf - Cumulative frequency

  6. cf(%) - Cumulative frequency, %

See Also