Learn R Programming

coenocliner (version 0.2-3)

prettyHead: Pretty Display of a Matrix or Data Frame

Description

Pretty display of the first n rows of a data frame or matrix-like object, with variables/columns that cannot fit on a single screen width removed.

Usage

prettyHead(x, n = 10, width = getOption("width"), zapsmall = FALSE)

Arguments

x

an R object for which head and as.data.frame methods exist.

n

numeric; the number of rows to display

width

numeric; the display width to assume when formatting the data frame. The default is given by getOption("width")

zapsmall

logical; should values close to zero be zapped to zero? See zapsmall for details.

Value

A format-ed data frame with n rows (or n+1 rows if only a subset is shown) and as many columns/components that can be printed on a single screen width.

Examples

Run this code
# NOT RUN {
x <- seq(from = 4, to = 6, length = 30)
opt <- seq(4, 7, length = 100)
tol <- rep(0.25, 100)
h <- rep(20, 100)

## simulate
set.seed(1)
y <- coenocline(x, responseModel = "gaussian",
                params = cbind(opt = opt, tol = tol, h = h),
                countModel = "poisson")

prettyHead(y)

# }

Run the code above in your browser using DataLab