print: 'print' methods

printR Documentation

print methods

Description

print methods

Usage

## S3 method for class 'ten'
print(
  x,
  ...,
  maxRow = getOption("datatable.print.nrows", 50L),
  nRowP = getOption("datatable.print.topn", 5L),
  pRowNames = TRUE,
  maxCol = getOption("survMisc.maxCol", 8L),
  nColSP = getOption("survMisc.nColSP", 7L),
  sigDig = getOption("survMisc.sigDig", 2L)
)

## S3 method for class 'COV'
print(x, ..., n = 2L)

## S3 method for class 'lrt'
print(x, ..., dist = c("n", "c"))

## S3 method for class 'sup'
print(x, ...)

## S3 method for class 'tableAndPlot'
print(x, ..., hideTabLeg = TRUE, tabHeight = 0.25)

## S3 method for class 'stratTableAndPlot'
print(x, ..., hideTabLeg = TRUE, tabHeight = 0.25)

Arguments

x

An object of class ten.

...

Additional arguments (not implemented).

–print.ten

maxRow

Maximum number of rows to print.
If nrow(x) > maxRow, just the first and last nRowP (below) are printed.
The default value is that used by data.table.

nRowP

Number of rows to print from the start and end of the object. Used if nrow(x) > maxRow.

pRowNames

Print row names?
Default is TRUE.

maxCol

Maximum number of columns to print.
If ncol(x) > maxCol, just the first nColSP and last maxCol - nColSP columns are printed.

nColSP

Number of columns to print from the start of the object. Used if Used if ncol(x) > maxCol.

sigDig

Significant digits. This is passed as an argument to
?signif
when preparing the object for printing.

–print.tableAndPlot and print.tableAndPlot

n

Similar to n from e.g.
?utils::head

–print.lrt

dist

Which distribution to use for the statistics when printing.
Default (dist="n") prints Z and p values based on the normal distribution.
If dist="c", gives values based on the chi-squared distribution.
The results are the same. The default value is typically easier to read. Both options are given for completeness.

hideTabLeg

Hide table legend.

tabHeight

Table height (relative to whole plot).

–print.COV

Details

Prints a ten object with 'nice' formatting.
Options may be set for a session using e.g.
options(survMisc.nColSP=4L)
It is similar to the behavior of print.data.table but has additional arguments controlling the number of columns sent to the terminal.

Value

A printed representation of the object is send to the terminal as a side effect of calling the function.
The return value cannot be assigned.

Note

All numeric arguments to the function must be supplied as integers.

Author(s)

Chris Dardis. Based on existing work by Brian Diggs.

See Also

For print.ten:

data.table:::print.data.table

?stats::printCoefmat

options()$datatable.print.nrows

sapply(c("datatable.print.nrows", "datatable.print.topn"), getOption)

Examples

set.seed(1)
(x <- data.table::data.table(matrix(rnorm(1800), ncol=15, nrow=120)))
data.table::setattr(x, "class", c("ten", class(x)))
p1 <- print(x)
stopifnot(is.null(p1))
x[1:80, ]
x[0, ]
(data.table::set(x, j=seq.int(ncol(x)), value=NULL))


survMisc documentation built on April 7, 2022, 5:06 p.m.