Learn R Programming

amt (version 0.2.2.0)

as.data.frame.uhc_data: Coerce a uhc_data object to data.frame

Description

Coerces uhc_data from list to data.frame

Usage

# S3 method for uhc_data
as.data.frame(x, row.names = NULL, optional = FALSE, ...)

Value

Returns a data.frame with columns:

  • var: The name of the variable

  • x: The x-coordinate of the density plot (the value of var).

  • y: The y-coordinate of the density plot (the probability density for a numeric var and the proportion for a factor var).

  • dist: The distribution represented. Either "U" for used, "A" for available, or "S" for sampled.

  • iter: The iteration number if dist == "S".

  • label: The label if var is a factor.

Arguments

x

[uhc_data] An object of class uhc_data, as returned by the function prep_uhc().

row.names

Included for consistency with generic as.data.frame(). Currently ignored.

optional

Included for consistency with generic as.data.frame(). Currently ignored.

...

Included for consistency with generic as.data.frame(). Currently ignored.

Author

Brian J. Smith

Details

This coercion aims to keep all of the information contained in the uhc_data list in the resulting data.frame representation. Factors are converted to numeric, but the levels are retained in the column "label".

See Also

prep_uhc(), conf_envelope()