tests/testthat/helper-heldout.R

# Fixtures for test-heldout.R.

# train_lev() has an isS4() branch for S4 model containers; this minimal class
# routes $ access into a list payload so the fake behaves like a train object.
setClass("fake_s4_train", representation(payload = "list"))
setMethod("$", "fake_s4_train", function(x, name) x@payload[[name]])

Try the caret package in your browser

Any scripts or data that you put into this service are public.

caret documentation built on Nov. 15, 2026, 9:06 a.m.