These two function are useful to test if an object is of class [Hmisc][Hmisc::describe].

is_hdesc(x)

is_single_hdesc(x)

Arguments

x

an object to test if it is of class `describe`.

Value

(lgl) is `x` (a single element or a general) `describe` object?

Details

In `Hmisc` both "single" `describe` objects and lists of them are of class `describe`. In particular, even if `Hmisc::describe()` results in a single variable description, it is directly the "single" `describe` object and not a list of them with only a single `describe` object included!

`is_hdesc()` test for general inheritance.

`is_single_hdesc()` test for single instance of a `describe` object.

See also

[describe][Hmisc::describe]

[is_hcat], [is_hcon], [htype], [htypes]

Examples

# \donttest{
  library(Hmisc)
  desc <- describe(mtcars)

  is_hdesc(desc) # TRUE
#> [1] TRUE
  is_hdesc(desc[[1L]]) # TRUE
#> [1] TRUE
# }
# \donttest{
  is_single_hdesc(desc) # FALSE
#> [1] FALSE
  is_single_hdesc(desc[[1L]]) # TRUE
#> [1] TRUE
# }