This function tests whether an object is a format catalog. The format catalog has a class of "fcat".
is.fcat(x)
TRUE or FALSE, depending on whether or not the object is a format catalog.
Other fcat:
as.data.frame.fcat()
,
as.fcat()
,
as.fcat.data.frame()
,
as.fcat.fmt_lst()
,
as.fcat.list()
,
fcat()
,
print.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"
# Test for "fcat" class
is.fcat(c1)
#> [1] TRUE
# [1] TRUE
is.fcat(Sys.Date())
#> [1] FALSE
# [1] FALSE