publish.matrix {Publish}R Documentation

Publishing a matrix in raw, org, latex, or muse format

Description

This is the heart of the Publish package

Usage

## S3 method for class 'matrix'
publish(
  object,
  title,
  colnames = TRUE,
  rownames = TRUE,
  col1name = "",
  digits = 4,
  try.convert = TRUE,
  sep = " ",
  endhead,
  endrow,
  style,
  inter.lines,
  latex = FALSE,
  wiki = FALSE,
  org = FALSE,
  markdown = FALSE,
  tabular = TRUE,
  latex.table.format = NA,
  latex.hline = 1,
  latex.nodollar = FALSE,
  ...
)

Arguments

object

Matrix to be published

title

Title for table, only in wiki and muse format

colnames

If TRUE show column names

rownames

If TRUE show row names

col1name

Name for first column

digits

Numbers are rounded according to digits

try.convert

Logical. If TRUE try to convert also non-numeric formats such as character to numeric before rounding. Default is TRUE.

sep

Field separator when style is "none"

endhead

String to be pasted at the end of the first row (header)

endrow

String to be pasted at the end of each row

style

Table style for export to "latex", "org", "markdown", "wiki", "none". Overwritten by argments below.

inter.lines

A named list which contains strings to be placed between the rows of the table. An element with name "0" is used to place a line before the first column, elements with name "r" are placed between line r and r+1.

latex

If TRUE use latex table format

wiki

If TRUE use mediawiki table format

org

If TRUE use emacs orgmode table format

markdown

If TRUE use markdown table format

tabular

For style latex only: if TRUE enclose the table in begin/end tabular environement.

latex.table.format

For style latex only: format of the tabular environement.

latex.hline

For style latex only: if TRUE add hline statements add the end of each line.

latex.nodollar

For style latex only: if TRUE do not enclose numbers in dollars.

...

Used to transport arguments. Currently supports wiki.class.

Examples


x <- matrix(1:12,ncol=3)
publish(x)

# rounding the numeric part of data mixtures 
y <- cbind(matrix(letters[1:12],ncol=3),x,matrix(rnorm(12),ncol=3))
publish(y,digits=1)

publish(x,latex=TRUE,
inter.lines=list("1"="text between line 1 and line 2",
                          "3"="text between line 3 and line 4"))


[Package Publish version 2023.01.17 Index]