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.
# S3 method for class 'fcat'
print(x, ..., verbose = FALSE)
The object, invisibly.
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()
#' # 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")
#> # A user-defined format: 3 conditions
#> Name Type Expression Label Order
#> 1 x U x == "A" Label A NA
#> 2 x U x == "B" Label B NA
#> 3 x U TRUE Other NA
#> # A format catalog: 3 formats
#> - $num_fmt: type S, "%.1f"
#> - $label_fmt: type U, 3 conditions
#> - $date_fmt: type S, "%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"
# # A format catalog: 3 formats
# - $num_fmt: type S, "%.1f"
# - $label_fmt: type U, 3 conditions
# - $date_fmt: type S, "%d%b%Y"