print.xtable {bpca}R Documentation

Print Method for xtable.bpca Objects

Description

Returns (and prints) a summary list for xtable.bpca objects.

Usage

## S3 method for class 'xtable.bpca'
print(x, 
      hline.after = getOption("xtable.hline.after", NULL), 
      include.colnames = getOption("xtable.include.colnames", FALSE), 
      add.to.row = getOption("xtable.add.to.row", NULL), 
      sanitize.text.function = getOption("xtable.sanitize.text.function", NULL),
      sanitize.rownames.function = getOption("xtable.sanitize.rownames.function", 
                                             sanitize.text.function), 
      sanitize.colnames.function = getOption("xtable.sanitize.rownames.function", 
                                             sanitize.text.function),...)

Arguments

x

A given object of the class xtable or xtable.bpca.

hline.after

When type="latex", a vector of numbers between -1 and nrow(x), inclusive, indicating the rows after which a horizontal line should appear. Default value is NULL which means draw a line before and after the columns names, draw a line before variables and at the end of the table.

include.colnames

If TRUE the columns names are printed. Default value is FALSE which means a column more elaborate was done.

add.to.row

A list of two components. The first component (which should be called 'pos') is a list that contains the position of rows on which extra commands should be added at the end. The second component (which should be called 'command') is a character vector of the same length as the first component, which contains the command that should be added at the end of the specified rows. Default value is NULL.

sanitize.text.function

All non-numeric entries (except row and column names) are sanitized in an attempt to remove characters which have special meaning for the output format. If sanitize.text.function is not NULL, it should be a function taking a character vector and returning one, and will be used for the sanitization instead of the default internal function. Default value is NULL.

sanitize.rownames.function

Like the sanitize.text.function, but applicable to row names. The default uses the sanitize.text.function.

sanitize.colnames.function

Like the sanitize.text.function, but applicable to column names. The default uses the sanitize.text.function.

...

Other arguments of the print.xtable function (see xtable package).

Author(s)

Faria, J. C.
Allaman, I. B.
Demétrio C. G. B.

See Also

xtable.bpca; xtable

Examples


## Example 1: Principal labels in portuguese
library(xtable)

bp2 <- bpca(gabriel1971)  
tbl <- xtable(bp2)
rownames(tbl) <- gsub('Eigenvectors','Autovetores',rownames(tbl))
rownames(tbl) <- c(rownames(tbl)[1:9],'Autovalores','Variância retida','Variância acumulada')
dimnames(tbl)[[2]] <- c('CP 1','CP 2')

print(tbl)

## Example 2: With bold in the column  
tbl1 <- xtable(bp2)
bold <- function(x){
  paste('\textbf{',
        x, 
        '}')
}

print(tbl1,
      sanitize.colnames.function = bold)

# Example 3: With italic in the rows
tbl2 <- xtable(bp2)
italic <- function(x){
  paste('& \textit{',
        x, 
        '}')
} # It is necessary the character "&" to adapt the number of column of the table!

print(tbl2,
      sanitize.rownames.function = italic)


[Package bpca version 1.3-6 Index]