coerce: Convert an object to another class

coerceR Documentation

Convert an object to another class

Description

Convert object between COBRAPerformance and COBRAPlot classes.

Arguments

from

The object that is to be coerced into another class.

Author(s)

Charlotte Soneson

Examples

data(cobradata_example)
cobraperf <- calculate_performance(cobradata_example,
                                   binary_truth = "status",
                                   aspects = "fdrtpr")
cobraplot <- prepare_data_for_plot(cobraperf)

## Coerce COBRAPerformance object into COBRAPlot object
as(cobraperf, "COBRAPlot")

## Coerce COBRAPlot object into COBRAPerformance object
as(cobraplot, "COBRAPerformance")

markrobinsonuzh/iCOBRA documentation built on March 28, 2024, 2:01 p.m.