Learn R Programming

softclassval (version 1.0-20160527)

checkrp: Input checks and reference preparation for performance calculation

Description

Checks whether r and p are valid reference and predictions. If p is a multiple of r, recycles r to the size and shape of p. If r has additional length 1 dimensions (usually because dimensions were dropped from p), it is shortend to the shape of p.

Usage

checkrp(r, p)

Arguments

r
reference
p
prediction

Value

r, possibly recycled to length of p or with dimensions shortened to p.

Details

In addition, any NAs in p are transferred to r so that these samples are excluded from counting in nsamples.

checkrp is automatically called by the performance functions, but doing so beforehand and then setting .checked = TRUE can save time when several performance measures are to be calculated on the same results.

Examples

Run this code
ref <- softclassval:::ref
ref

pred <- softclassval:::pred
pred

ref <- checkrp (r = ref, p = pred)
sens (r = ref, p = pred, .checked = TRUE)

Run the code above in your browser using DataLab