format: Encode in a Common Format

format.lcensR Documentation

Encode in a Common Format

Description

Formats data for pretty printing: methods for "lcens," "mcens," and "qw" data.

Usage

## S3 method for class 'lcens'
format(x, digits = NULL, ...)

## S3 method for class 'mcens'
format(x, digits = NULL, ...)

## S3 method for class 'qw'
format(x, round = TRUE, units = FALSE, style = "asis", ...)

Arguments

x

the censored data object to format.

digits

how many significant digits are to be used for numbers?

...

further arguments passed to or from other methods.

round

round the data before formating? Can also be a numeric vector of length 2 containing the maximum number of significant digits and the maximum number of decimal digits.

units

logical, if TRUE then include the units of the data.

style

the style for objects of class "qw." See Details.

Details

The argument style must be one of "asis," which tries to format the data to best show the values; "simple," which is like "asis" except that interval censored data are the midrange values preceded by "I"; or "interpreted," which shows the values as they would be used in analysis and round is ignored. Only the first letter is required.

Value

A character representations of the elements of x.

Note

For style set to "asis," it is often useful to set round to a single value so that the interval data are not rounded to the same value.

Examples


format(as.lcens(1:3, 1))
format(as.mcens(1:3, 1:3))


USGS-R/smwrQW documentation built on Oct. 11, 2022, 6:13 a.m.