print.fcat: Print a format catalog

View source: R/fcat.R

print.fcatR Documentation

Print a format catalog

Description

A class-specific instance of the print function for format catalogs. The function prints the format catalog in a tabular manner. Use verbose = TRUE to print the catalog as a list.

Usage

## S3 method for class 'fcat'
print(x, ..., verbose = FALSE)

Arguments

x

The format catalog to print.

...

Any follow-on parameters.

verbose

Whether or not to print the format catalog in verbose style. By default, the parameter is FALSE, meaning to print in tabular style.

Value

The object, invisibly.

See Also

Other fcat: as.data.frame.fcat(), as.fcat(), as.fcat.data.frame(), as.fcat.fmt_lst(), as.fcat.list(), fcat(), is.fcat(), read.fcat(), write.fcat()

Examples

#' # Create format catalog
c1 <- fcat(num_fmt  = "%.1f",
           label_fmt = value(condition(x == "A", "Label A"),
                             condition(x == "B", "Label B"),
                             condition(TRUE, "Other")),
           date_fmt = "%d%b%Y")
           
# Print the catalog
print(c1)
# # A format catalog: 3 formats
# - $num_fmt: type S, "%.1f"
# - $label_fmt: type U, 3 conditions
# - $date_fmt: type S, "%d%b%Y"

dbosak01/fmtr documentation built on June 15, 2024, 4:26 a.m.