tests/testthat/test-inline.R

test_that("orbital works with workflows - recipe", {
	skip_if_not_installed("recipes")
	skip_if_not_installed("tidypredict")
	skip_if_not_installed("workflows")

	rec_spec <- recipes::recipe(mpg ~ ., data = mtcars) %>%
		recipes::step_normalize(recipes::all_numeric_predictors())

	lm_spec <- parsnip::linear_reg()

	wf_spec <- workflows::workflow() %>%
		workflows::add_recipe(rec_spec) %>%
		workflows::add_model(lm_spec)

	wf_fit <- parsnip::fit(wf_spec, mtcars)

	obj <- orbital(wf_fit)

	res <- orbital_inline(obj)

	expect_s3_class(res, "quosures")
	expect_named(res, names(obj))
	expect_length(res, length(obj))
})

Try the orbital package in your browser

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

orbital documentation built on April 3, 2025, 8:47 p.m.