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

View source: R/uhc_plots.R

as.data.frame.uhc_dataR Documentation

Coerce a uhc_data object to data.frame

Description

Coerces uhc_data from list to data.frame

Usage

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

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.

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".

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.

Author(s)

Brian J. Smith

See Also

prep_uhc(), conf_envelope()


amt documentation built on June 25, 2024, 1:14 a.m.