Learn R Programming

micompr (version 1.1.4)

toLatex.micomp: Convert micomp object to LaTeX table

Description

This method converts micomp objects to character vectors representing LaTeX tables.

Usage

# S3 method for micomp
toLatex(
  object,
  ...,
  orientation = T,
  data_show = c("npcs-1", "mnvp-1", "parp-1", "nparp-1", "scoreplot"),
  data_labels = NULL,
  labels_cmp_show = T,
  labels_col_show = T,
  label_row_show = T,
  tag_comp = "Comp.",
  tag_data = "Data",
  tag_outputs = "Outputs",
  table_placement = "ht",
  latex_envs = c("center"),
  booktabs = F,
  booktabs_cmalign = "l",
  caption = NULL,
  caption_cmd = "\\caption",
  label = NULL,
  col_width = F,
  pvalf_f = pvalf.default,
  pvalf_params = list(),
  scoreplot_marks = c("mark=square*,mark options={color=red},mark size=0.8pt",
    "mark=diamond*,mark options={color=black},mark size=1pt",
    "mark=triangle*,mark options={color=green},mark size=1pt"),
  scoreplot_scale = 6,
  scoreplot_before = "\\raisebox{-.5\\height}{\\resizebox {1.2cm} {1.2cm} {",
  scoreplot_after = "}}"
)

Value

A character vector where each element holds one line of the corresponding LaTeX table.

Arguments

object

A micomp object.

...

Currently ignored.

orientation

If TRUE, outputs are placed along columns, while data is placed along rows. If FALSE, outputs are placed along rows, while data is placed along columns.

data_show

Vector of strings specifying what data to show. Available options are:

npcs-i

Number of principal components required to explain i-th user-specified percentage of variance.

mnvp-i

MANOVA p-values for the i-th user-specified percentage of variance to explain.

parp-j

Parametric test p-values for the j-th principal component.

nparp-j

Non-parametric test p-values for the j-th principal component.

aparp-j

Parametric test p-values adjusted with weighted Bonferroni procedure for the j-th principal component.

anparp-j

Non-parametric test p-values adjusted with weighted Bonferroni procedure for the j-th principal component.

varexp-j

Explained variance for the j-th principal component.

scoreplot

Output projection on the first two principal components.

sep

Place a separator (e.g. midrule) between data.

data_labels

Vector of strings specifying the labels of the data to show. If NULL, default labels are used for all elements. If individual elements are set to NA, default labels will be used for those elements.

labels_cmp_show

Show the column containing the comparison labels?

labels_col_show

Show the column containing the data labels (orientation == T) or the output labels (orientation == F)?

label_row_show

Show the tag_outputs tag? If TRUE, the row identifier part will have two levels, the tag_outputs label and output names (orientation == T), or the tag_data and data labels (orientation == F). If FALSE only the output names or data labels are shown.

tag_comp

Tag identifying comparison labels.

tag_data

Tag identifying data labels.

tag_outputs

Tag identifying outputs.

table_placement

LaTeX table placement.

latex_envs

Wrap table in the specified LaTeX environments.

booktabs

Use booktabs table beautifier package?

booktabs_cmalign

How to align cmidule when using the booktabs package.

caption

Table caption.

caption_cmd

Command used for table caption.

label

Table label for cross-referencing.

col_width

Resize table to page column width?

pvalf_f

P-value formatter function, which receives a numeric value between 0 and 1 and returns a string containing the formatted value. Default is pvalf.default (requires ulem LaTeX package).

pvalf_params

Parameters for pvalf_f function. Default is empty list.

scoreplot_marks

Vector of strings specifying how TikZ should draw points belonging to each group in the score plot.

scoreplot_scale

TikZ scale for each score plot figure.

scoreplot_before

LaTeX code to paste before each TikZ score plot figure.

scoreplot_after

LaTeX code to paste after each TikZ score plot figure.

Details

This method is inspired by the functionality provided by the xtable and print.xtable functions (from the xtable package), but follows the standard behavior of the toLatex generic.

Examples

Run this code

# Create a micomp object, use provided dataset, three first outputs, plus
# a fourth concatenated output
mic <- micomp(4, 0.8,
              list(list(name = "NLOKvsJEXOK", grpout = pphpc_ok),
                   list(name = "NLOKvsJEXNOSHUFF", grpout = pphpc_noshuff),
                   list(name = "NLOKvsJEXDIFF", grpout = pphpc_diff)),
              concat = TRUE)

# Print latex table source to screen
toLatex(mic)

Run the code above in your browser using DataLab