Learn R Programming

hce (version 0.8.8)

as_hce.data.frame: Coerce a data frame to an hce object

Description

Coerce a data frame to an hce object

Usage

# S3 method for data.frame
as_hce(x, ...)

Value

an hce object.

Arguments

x

a data frame.

...

additional parameters.

See Also

as_hce(), as_hce.default().

Examples

Run this code
# The case when all required variables `AVAL0`, `GROUP`, `PADY`, and `TRTP` are present.
KHCE <- as_hce(KHCE)
## Converts to an `adhce` object
class(KHCE)
calcWO(KHCE)
# The case when only `AVAL` and `TRTP`.
## Converts to an `hce` object
dat <- KHCE[, c("TRTP", "AVAL")]
dat <- as_hce(dat)
class(dat)
summaryWO(dat)

Run the code above in your browser using DataLab