Learn R Programming

depigner (version 0.9.1)

is_hdesc: Checks for describe objects

Description

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

Usage

is_hdesc(x)

is_single_hdesc(x)

Value

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

Arguments

x

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

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

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

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

Run the code above in your browser using DataLab