Skip to contents

[Experimental]

Returns the ADaM class declared for a dataset with admiral_df() if there is one, and otherwise the class inferred from its variables and records, see infer_dataset_class().

Usage

get_dataset_class(dataset)

Arguments

dataset

A data frame

Permitted values

a data frame

Default value

none

Value

A character scalar: the declared class, or the inferred one (which may be "other" or NA, see infer_dataset_class()).

Examples

library(tibble)

advs <- tribble(
  ~STUDYID, ~USUBJID, ~PARAMCD, ~AVAL,
  "P",      "1",      "DIABP",     51,
  "P",      "1",      "SYSBP",    121
)

# no class has been declared, so it is inferred
get_dataset_class(advs)
#> [1] "BDS"

# a declared class takes precedence
advs <- admiral_df(advs, dataset_class = "TTE")
get_dataset_class(advs)
#> [1] "TTE"